I'm going to build mmorpg server with reusable sockets
An accepted socket (via AcceptEx and posted one WSARecv()) is disconnected by peer (by zero byte notify receiving) in that case, could I call TransmitFile (TF_DISCONNECT | TF_REUSE_SOCKET) ? if its not possible, what should I do?
If my server received an illegal packet or some hack attempts by peer, so I've to disconnect peer, how could I disconnect peer immediately (non-graceful) and make peer socket reusable?
Some pseudo codes
Enqueue received data and post new WSARecv() directly, then process received data (in order to, get received data(s) and enqueue them while processing received packets)
WSARecv(socket, recvBuffer, dwRecvBytes)
int read = CircularBuffer->ReadData(buf, sizeof buf);
Process received data and post new WSARecv()
WSARecv(socket, recvBuffer, dwRecvBytes);
which method is better for performance ?
DisconnectEx (TF_REUSE_SOCKET) versus TransmitFile (TF_DISCONNECT | TF_REUSE_SOCKET), are there any performance issues? which one should I use for make socket reusable?
Edited by rigel, 08 July 2014 - 03:45 PM.