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

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