Esempio n. 1
0
        public void Awake(NetworkProtocol protocol)
        {
            switch (protocol)
            {
            case NetworkProtocol.TCP:
                this.Service = new TService();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Esempio n. 2
0
        public void Awake(NetworkProtocol protocol, IPEndPoint ipEndPoint)
        {
            try {
                switch (protocol)
                {
                case NetworkProtocol.TCP:
                    this.Service = new TService(ipEndPoint);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                this.StartAccept();
            }
            catch (Exception e) {
                throw new Exception($"{ipEndPoint}", e);
            }
        }
Esempio n. 3
0
 protected AChannel(AService service, ChannelType channelType)
 {
     this.Id          = IdGenerater.GenerateId();
     this.ChannelType = channelType;
     this.service     = service;
 }