Example #1
0
 public void Init(ref ITcpServer server)
 {
     if (server == null)
     {
         throw new NullReferenceException("server");
     }
     _server           = server;
     _connectHandlerId = Guid.NewGuid();
     _dataHandlerId    = Guid.NewGuid();
     //Console.WriteLine("Init....");
     _server.AddConnectionHandler(_connectHandlerId, OnClientConnection);
     _server.AddHandler(new TcpClientHandlerInfo(_dataHandlerId), OnClientExchange);
 }