I’m writing a simple proxy (more a packet logger) for an online game in C#.
The basic Login process is like this:
Client->Server: Login Packet – My proxy receives the packet, displays it and sends it to the server.
Server->Client: Connected! Packet – My proxy again receives the packet, it also displays it again but when trying to send it to the client, it says:
“A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.”
You shouldn’t be trying to send on this listening socket. You need to send on the socket that was created with EndAccept(). (winSock2 in your code – but you would need to scope it differently.)