Esempio n. 1
0
 public void AcceptSocket(Socket receiveSocket, IAcceptor acceptor)
 {
     try
     {
         IByteParser parser = _parserFactory.Create(receiveSocket);
         PgmSocket.EnableGigabit(receiveSocket);
         if (_receiveBufferSize > 0)
         {
             receiveSocket.ReceiveBufferSize = _receiveBufferSize;
         }
         byte[]      buffer = new byte[_readBuffer];
         AsyncReader reader = new AsyncReader(parser, buffer, acceptor, this, receiveSocket);
         reader.BeginReceive();
     }catch (Exception failed)
     {
         receiveSocket.Close();
         log.Error("BeginReceive Failed", failed);
     }
 }
Esempio n. 2
0
 public void AcceptSocket(Socket receiveSocket, IAcceptor acceptor)
 {
     try
     {
         IByteParser parser = _parserFactory.Create(receiveSocket);
         PgmSocket.EnableGigabit(receiveSocket);
         if (_receiveBufferSize > 0)
         {
             receiveSocket.ReceiveBufferSize = _receiveBufferSize;
         }
         byte[] buffer = new byte[_readBuffer];
         AsyncReader reader = new AsyncReader(parser, buffer, acceptor, this, receiveSocket);
         reader.BeginReceive();
     }catch(Exception failed)
     {
         receiveSocket.Close();
         log.Error("BeginReceive Failed", failed);
     }
 }