public override AChannel GetChannel(long id) { TChannel channel = null; this.idChannels.TryGetValue(id, out channel); return(channel); }
public override AChannel ConnectChannel(string host, int port) { TSocket newSocket = new TSocket(this.poller); TChannel channel = new TChannel(newSocket, host, port, this); this.idChannels[channel.Id] = channel; return channel; }
public override AChannel ConnectChannel(string host, int port) { TSocket newSocket = new TSocket(this.poller); TChannel channel = new TChannel(newSocket, host, port, this); this.idChannels[channel.Id] = channel; return(channel); }
public override AChannel GetChannel(string host, int port) { TChannel channel = null; TSocket newSocket = new TSocket(this.poller); channel = new TChannel(newSocket, host, port, this); channel.OnError += this.OnChannelError; this.idChannels[channel.Id] = channel; return(channel); }
public override async Task<AChannel> AcceptChannel() { if (this.acceptor == null) { throw new Exception("service construct must use host and port param"); } TSocket socket = new TSocket(this.poller); await this.acceptor.AcceptAsync(socket); TChannel channel = new TChannel(socket, this); this.idChannels[channel.Id] = channel; return channel; }
public override async Task <AChannel> AcceptChannel() { if (this.acceptor == null) { throw new Exception("service construct must use host and port param"); } TSocket socket = new TSocket(this.poller); await this.acceptor.AcceptAsync(socket); TChannel channel = new TChannel(socket, this); this.idChannels[channel.Id] = channel; return(channel); }
public override void Dispose() { if (this.poller == null) { return; } foreach (long id in this.idChannels.Keys.ToArray()) { TChannel channel = this.idChannels[id]; channel.Dispose(); } this.poller = null; }
private void Dispose(bool disposing) { if (this.poller == null) { return; } if (disposing) { foreach (long id in this.idChannels.Keys.ToArray()) { TChannel channel = this.idChannels[id]; channel.Dispose(); } } this.poller = null; }