public override AChannel GetChannel(long id) { UChannel channel = null; this.idChannels.TryGetValue(id, out 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 AChannel ConnectChannel(IPEndPoint ipEndPoint) { USocket newSocket = new USocket(this.poller); UChannel channel = new UChannel(newSocket, ipEndPoint, 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 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; }