Start() public method

public Start ( ) : void
return void
Example #1
0
 private void AcceptCallback(IAsyncResult result)
 {
     try {
         var tcpclient = listener.EndAcceptTcpClient(result);
         var client    = new HttpClient(this, tcpclient);
         try {
             clients.AddOrUpdate(client, DateTime.Now, (k, v) =>
             {
                 return(DateTime.Now);
             });
             DebugFormat("Accepted client {0}", client);
             client.Start();
         }
         catch (Exception) {
             client.Dispose();
             throw;
         }
     }
     catch (ObjectDisposedException) {
     }
     catch (Exception ex) {
         Error("Failed to accept a client", ex);
     }
     finally {
         Accept();
     }
 }
Example #2
0
 private void AcceptCallback(IAsyncResult result)
 {
   try {
     var tcpclient = listener.EndAcceptTcpClient(result);
     var client = new HttpClient(this, tcpclient);
     try {
       clients.AddOrUpdate(client, DateTime.Now, (k, v) =>
       {
         return DateTime.Now;
       });
       DebugFormat("Accepted client {0}", client);
       client.Start();
     }
     catch (Exception) {
       client.Dispose();
       throw;
     }
   }
   catch (ObjectDisposedException) {
   }
   catch (Exception ex) {
     Error("Failed to accept a client", ex);
   }
   finally {
     Accept();
   }
 }