Inheritance: UvStream
Esempio 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);
     }
 }
Esempio n. 2
0
 public void Connect(IPEndPoint endpoint, Action <UvArgs> callback = null)
 {
     this.Connect(TcpSocket.AllocSocketAddress(endpoint, this.Loop), callback);
 }
Esempio n. 3
0
 public void Connect(string ip, int port, Action <UvArgs> callback = null)
 {
     this.Connect(TcpSocket.AllocSocketAddress(new IPEndPoint(IPAddress.Parse(ip), port), this.Loop), callback);
 }