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

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
示例#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);
            }
        }
示例#3
0
 protected AChannel(AService service, ChannelType channelType)
 {
     this.Id          = IdGenerater.GenerateId();
     this.ChannelType = channelType;
     this.service     = service;
 }