Ejemplo n.º 1
0
 public void StartListening(IPEndPoint endpoint, Action <UvArgs <TcpServerSocket> > callback = null)
 {
     try
     {
         _address = this.Loop.Allocs.Free(_address);
         _address = TcpSocket.AllocSocketAddress(endpoint, this.Loop);
         CheckError(Uvi.uv_tcp_bind(this.Handle, _address, 0));
         CheckError(Uvi.uv_listen(this.Handle, this.BackLog, _connectionDelegate));
         this.Status      = HandleStatus.Open;
         _connectCallback = new UvTcpServerSocketCallback(this, callback);
     }
     catch (Exception)
     {
         _address = this.Loop.Allocs.Free(_address);
     }
 }