bump.
The following problems detected:
In some cases socket get corrupted
after receiving data from it for unknown reason.
As
xOR said, socket_change actually returns 1 on socket error. It even returns 1 on closed socket. But there is more! socket_recv may or may not crush your server (depending on which version you use), but if there was error, it actually returns -1 and empty buffer. So conditional statemant if (socket_recv) is incorrect, use if (socket_recv>0) instead. You can also use if (socket_recv<0) to detect error.
So, the only stable way to ensure socket to work correctly is to reset (close/open) it each time after it socket_recv. But i still don't understand why it gets corrupted after socket_recv and why it works so fine after being reseted - it really should allocate a different port instead of using the same port - so incoming packets should be lost, but they are not, and you can be read them with socket_recv
Any explanation will be really appreciated!
__________________