コード例 #1
0
 public TSocket(TPoller poller)
 {
     this.poller             = poller;
     this.socket             = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     this.innArgs.Completed += this.OnComplete;
     this.outArgs.Completed += this.OnComplete;
 }
コード例 #2
0
ファイル: TSocket.cs プロジェクト: egametang/Egametang
		public TSocket(TPoller poller)
		{
			this.poller = poller;
			this.socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
			this.innArgs.Completed += this.OnComplete;
			this.outArgs.Completed += this.OnComplete;
		}
コード例 #3
0
 public TSocket(TPoller poller, string host, int port) : this(poller)
 {
     try
     {
         this.Bind(host, port);
         this.Listen(100);
     }
     catch (Exception e)
     {
         throw new Exception($"socket bind error: {host} {port}", e);
     }
 }
コード例 #4
0
ファイル: TSocket.cs プロジェクト: egametang/Egametang
		public TSocket(TPoller poller, string host, int port): this(poller)
		{
			try
			{
				this.Bind(host, port);
				this.Listen(100);
			}
			catch (Exception e)
			{
				throw new Exception($"socket bind error: {host} {port}", e);
			}
		}
コード例 #5
0
ファイル: TService.cs プロジェクト: egametang/Egametang
		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.acceptor?.Dispose();
			this.poller = null;
		}
コード例 #6
0
        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;
        }
コード例 #7
0
        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;
        }