public override AChannel ConnectChannel(string host, int port) { USocket newSocket = new USocket(this.poller); UChannel channel = new UChannel(newSocket, host, port, this); this.idChannels[channel.Id] = channel; return channel; }
public override AChannel GetChannel(long id) { UChannel channel = null; this.idChannels.TryGetValue(id, out channel); return(channel); }
public override async Task<AChannel> AcceptChannel() { USocket socket = await this.poller.AcceptAsync(); UChannel channel = new UChannel(socket, this); this.idChannels[channel.Id] = channel; return channel; }
public override AChannel ConnectChannel(string host, int port) { USocket newSocket = new USocket(this.poller); UChannel channel = new UChannel(newSocket, host, port, this); this.idChannels[channel.Id] = channel; return(channel); }
public override async Task <AChannel> AcceptChannel() { USocket socket = await this.poller.AcceptAsync(); UChannel channel = new UChannel(socket, this); this.idChannels[channel.Id] = channel; return(channel); }
public override AChannel GetChannel(string host, int port) { UChannel channel = null; USocket newSocket = new USocket(this.poller); channel = new UChannel(newSocket, host, port, this); newSocket.Disconnect += () => this.OnChannelError(channel.Id, SocketError.SocketError); this.idChannels[channel.Id] = channel; return(channel); }
public override void Dispose() { if (this.poller == null) { return; } foreach (long id in this.idChannels.Keys.ToArray()) { UChannel 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()) { UChannel channel = this.idChannels[id]; channel.Dispose(); } this.poller.Dispose(); } this.poller = null; }