AllocSocketAddress() static private method

static private AllocSocketAddress ( IPEndPoint endpoint, Loop loop ) : IntPtr
endpoint System.Net.IPEndPoint
loop Loop
return System.IntPtr
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);
     }
 }
Ejemplo n.º 2
0
 public void Connect(IPEndPoint endpoint, Action <UvArgs> callback = null)
 {
     this.Connect(TcpSocket.AllocSocketAddress(endpoint, this.Loop), callback);
 }
Ejemplo 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);
 }