Inheritance: IDisposable
		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();
			}
		}
Beispiel #2
0
        private void Dispose(bool disposing)
        {
            if (this.service == null)
            {
                return;
            }

            base.Dispose();

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

            this.service = null;
        }
		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();
		}
Beispiel #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();
            }
        }
Beispiel #5
0
 protected AChannel(AService service)
 {
     this.Id      = IdGenerater.GenerateId();
     this.service = service;
 }
Beispiel #6
0
 protected AChannel(AService service, ChannelType channelType)
 {
     this.Id          = IdGenerater.GenerateId();
     this.ChannelType = channelType;
     this.service     = service;
 }
Beispiel #7
0
		protected AChannel(AService service, ChannelType channelType)
		{
			this.Id = IdGenerater.GenerateId();
			this.ChannelType = channelType;
			this.service = service;
		}