Here is a scenario with asynchronous sockets, which I donβt quite understand ... I have 2 Tcp sockets, a client socket and a server socket. My server socket is connected and is listening on a port.
My client sockets connect to a server socket (using BeginConnect / EndConnect). Then I send a message to the server using the BeginSend () function. On the server side, I do not do Receive () or BeginReceive ().
What happens is that my AsyncCallback specified for my BeginSend call is called and its IAsyncResult tells me that it is completed, and calling Socket.EndSend () does not raise any exception ...
Is there something that I do not receive or should not call my AsyncCallback only if the BeginSend call actually sends something to the server (i.e.: callback is called after the server has received all the bytes)? If there was no reception on the server, should my callback not be called after the send time has elapsed, and my call to Socket.EndSend will throw an exception?
thank
source
share