Skydiver, on 03 July 2013 - 03:51 PM, said:
Okay, can you show us your client side code that tries to detect the IP address of the server? If you can't detect the IP address of the server, you have have no choice but to try to ask the user to enter the IP address.
ser.sin_family=AF_INET;
ser.sin_port=htons(2359);
ser.sin_addr.s_addr=inet_addr("IPv4 ADDRESS HERE");
memcpy(&addr,&ser,sizeof(SOCKADDR_IN));
res = WSAStartup(MAKEWORD(1,1),&data);
if(res != 0) {
gamerunning = false;
}
sock=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(sock==INVALID_SOCKET ) {
gamerunning = false;
} else if(sock==SOCKET_ERROR) {
gamerunning = false;
}
res=connect(sock,&addr,sizeof(addr));
if(res !=0 ) {
gamerunning = false;
} else {
memcpy(&ser,&addr,sizeof(SOCKADDR));
}
...

New Topic/Question
Reply



MultiQuote

|