Inheritance: IDisposable
Esempio n. 1
0
		protected void Awake(NetworkProtocol protocol)
		{
			switch (protocol)
			{
				case NetworkProtocol.TCP:
					this.Service = new TService();
					break;
				case NetworkProtocol.UDP:
					this.Service = new UService();
					break;
				default:
					throw new ArgumentOutOfRangeException();
			}
		}
Esempio n. 2
0
        private void Dispose(bool disposing)
        {
            if (this.service == null)
            {
                return;
            }

            base.Dispose();

            if (disposing)
            {
                this.service.Dispose();
            }

            this.service = null;
        }
Esempio n. 3
0
		protected void Awake(NetworkProtocol protocol, string host, int port)
		{
			switch (protocol)
			{
				case NetworkProtocol.TCP:
					this.Service = new TService(host, port);
					break;
				case NetworkProtocol.UDP:
					this.Service = new UService(host, port);
					break;
				default:
					throw new ArgumentOutOfRangeException();
			}

			this.StartAccept();
		}
Esempio n. 4
0
        public void Awake(NetworkProtocol protocol)
        {
            switch (protocol)
            {
            case NetworkProtocol.TCP:
                this.service = new TService {
                    OnError = this.OnError
                };
                break;

            case NetworkProtocol.UDP:
                this.service = new UService {
                    OnError = this.OnError
                };
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 5
0
 protected AChannel(AService service)
 {
     this.Id      = IdGenerater.GenerateId();
     this.service = service;
 }
Esempio n. 6
0
 protected AChannel(AService service, ChannelType channelType)
 {
     this.Id          = IdGenerater.GenerateId();
     this.ChannelType = channelType;
     this.service     = service;
 }
Esempio n. 7
0
		protected AChannel(AService service, ChannelType channelType)
		{
			this.Id = IdGenerater.GenerateId();
			this.ChannelType = channelType;
			this.service = service;
		}