public SocketClient(string ip, Int32 port, Int32 bufferSize, string localIp) { protocol = new BaseProtocol(); _client = new TCPAsyncClient(ip, port, bufferSize, protocol, localIp, 0); _client.Connected += client_Connected; _client.Closed += client_Closed; _client.Error += client_Error; protocol.Receive += protocol_ReceiveData; }
static void Main(string[] args) { TCPAsyncClient client = new TCPAsyncClient(args[0], Convert.ToInt32(args[1])); client.Start(); }