L
linuxfedora
Sometime, when i try to use the following function to connect to a
socket, it will come out the error as below, but it seems the
arugments are correct, ip and port are correct, then what would be the
cause of that?thanks
public void Connect(string ip, int port)
{
this.ip = ip;
this.port = port;
try
{
handle.BeginConnect(ip, port, new
AsyncCallback(OnConnectCallBack), null);
}
catch (SocketException e)
{
ThrowError(e);
}
catch (Exception e)
{
ThrowError(e);
}
}
©ó System.Net.Sockets.Socket.DoMultipleAddressConnectCallback(Object
result, MultipleAddressConnectAsyncResult context)
©ó System.Net.Sockets.Socket.BeginConnect(String host, Int32 port,
AsyncCallback requestCallback, Object state)
socket, it will come out the error as below, but it seems the
arugments are correct, ip and port are correct, then what would be the
cause of that?thanks
public void Connect(string ip, int port)
{
this.ip = ip;
this.port = port;
try
{
handle.BeginConnect(ip, port, new
AsyncCallback(OnConnectCallBack), null);
}
catch (SocketException e)
{
ThrowError(e);
}
catch (Exception e)
{
ThrowError(e);
}
}
©ó System.Net.Sockets.Socket.DoMultipleAddressConnectCallback(Object
result, MultipleAddressConnectAsyncResult context)
©ó System.Net.Sockets.Socket.BeginConnect(String host, Int32 port,
AsyncCallback requestCallback, Object state)