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; }
/// <summary> /// 只能做client /// </summary> public UService() { this.poller = new UPoller(); }
/// <summary> /// 即可做client也可做server /// </summary> public UService(string host, int port) { this.poller = new UPoller(host, (ushort)port); }
public USocket(UPoller poller) { this.poller = poller; }
public USocket(IntPtr peerPtr, UPoller poller) { this.poller = poller; this.PeerPtr = peerPtr; }