I tried this too, but the same issue with one sec connection interupted after call :D
Printable View
I tried this too, but the same issue with one sec connection interupted after call :D
You could just add an error check:
Would print: recvfrom failed with error 10040PHP Code:
i = recvfrom(Socket, response, sizeof(response), 0, 0, 0);
if (i == SOCKET_ERROR) {
Com_Printf("recvfrom failed with error %d\n", WSAGetLastError());
stackPushString("hurrdurr");
}
Google: http://support.ipswitch.com/kb/WSK-19980714-EM13.htm
Check the size of your buffer:Quote:
Question/Problem: Message too long.
Answer/Solution: A message sent on a socket was larger than the internal message buffer or some other network limit.
Realize that strlen(response) is always 0, since empty arrays are initialized to zero.PHP Code:
char response[1024];
i = recvfrom(Socket, response, strlen(response), 0, 0, 0);
Set the size with sizeof() instead and it will work:
PHP Code:
i = recvfrom(Socket, response, sizeof(response), 0, 0, 0);
Thank you man! Its working strlen was a bad choice, with sizeof its ok!!