Example #1
0
        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;
        }
Example #2
0
 /// <summary>
 /// 只能做client
 /// </summary>
 public UService()
 {
     this.poller = new UPoller();
 }
Example #3
0
 /// <summary>
 /// 即可做client也可做server
 /// </summary>
 public UService(string host, int port)
 {
     this.poller = new UPoller(host, (ushort)port);
 }
Example #4
0
 /// <summary>
 /// 即可做client也可做server
 /// </summary>
 public UService(IPEndPoint ipEndPoint)
 {
     this.poller = new UPoller(ipEndPoint.Address.ToString(), (ushort)ipEndPoint.Port);
 }
Example #5
0
 public USocket(UPoller poller)
 {
     this.poller = poller;
 }
Example #6
0
 public USocket(IntPtr peerPtr, UPoller poller)
 {
     this.poller  = poller;
     this.PeerPtr = peerPtr;
 }