Ejemplo n.º 1
0
 /// <summary>
 /// accept
 /// </summary>
 public UChannel(USocket socket, UService service) : base(service, ChannelType.Accept)
 {
     this.socket             = socket;
     this.service            = service;
     this.RemoteAddress      = socket.RemoteAddress;
     this.socket.Received   += this.OnRecv;
     this.socket.Disconnect += () => { this.OnError(this, SocketError.SocketError); };
 }
Ejemplo n.º 2
0
 /// <summary>
 /// connect
 /// </summary>
 public UChannel(USocket socket, string host, int port, UService service) : base(service, ChannelType.Connect)
 {
     this.socket        = socket;
     this.service       = service;
     this.RemoteAddress = host + ":" + port;
     this.socket.ConnectAsync(host, (ushort)port);
     this.socket.Received   += this.OnRecv;
     this.socket.Disconnect += () => { this.OnError(this, SocketError.SocketError); };
 }
Ejemplo n.º 3
0
 /// <summary>
 /// connect
 /// </summary>
 public UChannel(USocket socket, IPEndPoint ipEndPoint, UService service) : base(service, ChannelType.Connect)
 {
     this.socket        = socket;
     this.service       = service;
     this.RemoteAddress = ipEndPoint;
     this.socket.ConnectAsync(ipEndPoint);
     this.socket.Received   += this.OnRecv;
     this.socket.Disconnect += () => { this.OnError(this, SocketError.SocketError); };
 }