Inheritance: AChannel
Esempio n. 1
0
        public override AChannel GetChannel(long id)
        {
            TChannel channel = null;

            this.idChannels.TryGetValue(id, out channel);
            return(channel);
        }
Esempio n. 2
0
		public override AChannel ConnectChannel(string host, int port)
		{
			TSocket newSocket = new TSocket(this.poller);
			TChannel channel = new TChannel(newSocket, host, port, this);
			this.idChannels[channel.Id] = channel;

			return channel;
		}
Esempio n. 3
0
        public override AChannel ConnectChannel(string host, int port)
        {
            TSocket  newSocket = new TSocket(this.poller);
            TChannel channel   = new TChannel(newSocket, host, port, this);

            this.idChannels[channel.Id] = channel;

            return(channel);
        }
Esempio n. 4
0
        public override AChannel GetChannel(string host, int port)
        {
            TChannel channel   = null;
            TSocket  newSocket = new TSocket(this.poller);

            channel                     = new TChannel(newSocket, host, port, this);
            channel.OnError            += this.OnChannelError;
            this.idChannels[channel.Id] = channel;
            return(channel);
        }
Esempio n. 5
0
		public override async Task<AChannel> AcceptChannel()
		{
			if (this.acceptor == null)
			{
				throw new Exception("service construct must use host and port param");
			}
			TSocket socket = new TSocket(this.poller);
			await this.acceptor.AcceptAsync(socket);
			TChannel channel = new TChannel(socket, this);
			this.idChannels[channel.Id] = channel;
			return channel;
		}
Esempio n. 6
0
        public override async Task <AChannel> AcceptChannel()
        {
            if (this.acceptor == null)
            {
                throw new Exception("service construct must use host and port param");
            }
            TSocket socket = new TSocket(this.poller);

            await this.acceptor.AcceptAsync(socket);

            TChannel channel = new TChannel(socket, this);

            this.idChannels[channel.Id] = channel;
            return(channel);
        }
Esempio n. 7
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;
        }
Esempio n. 8
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;
        }