public void Awake(NetworkProtocol protocol) { switch (protocol) { case NetworkProtocol.TCP: this.Service = new TService(); break; default: throw new ArgumentOutOfRangeException(); } }
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); } }
protected AChannel(AService service, ChannelType channelType) { this.Id = IdGenerater.GenerateId(); this.ChannelType = channelType; this.service = service; }