Ejemplo n.º 1
0
 private void ConnectCallback(IAsyncResult ar)
 {
     try
     {
         var client = (Socket)ar.AsyncState;
         client.EndConnect(ar);
         var state = new StateObject(client);
         client.BeginReceive(state.GetBuffer(), 0, StateObject.BufferSize, 0, ReceiveCallback, state);
         client.ReceiveTimeout = 3000;
         client.Send(Payload());
     }
     catch (Exception e)
     {
         _logger.Log(LogLevel.Debug, e, "Tester Connection error");
         OnConnectionChange(false);
     }
 }