Hi there,
A SocketException error is thrown when a client disconnects through Read/Write/Accept operations.
When a SocketException is thrown I would love to have details about that 'Client' socket --
namely the Socket.RemoteEndPoint
Any way of getting this from the SocketException object?
I am particulary interested in obtaining request details from the BeginAccept/EndAccept routines.
private Socket _listeningSocket;
// _listeningSocket.Bind().Listen()._BeginAccept().etc
public static void _BeginAccept()
{
_listeningSocket.BeginAccept(new new AsyncCallback(_EndAccept),null);
}
public static void _EndAccept(IAsyncResult ar)
{
try
{
Socket acceptedSocket = _listeningSocket.EndAccept(ar);
Process(acceptedSocket);
}
catch(SocketException se)
{
/////////////////////////////////////////////////
// Who tried to connect to my _listeningSocket!!!
/////////////////////////////////////////////////
}
finally
{
_BeginAccept()
}
}