public void Initialize(NetworkProtocol rProtocol, IPEndPoint rIpEndPoint) { try { switch (rProtocol) { case NetworkProtocol.TCP: this.mService = new TService(rIpEndPoint); break; case NetworkProtocol.KCP: this.mService = new KService(rIpEndPoint); break; default: throw new ArgumentOutOfRangeException(); } this.StartAccept(); } catch (Exception e) { throw new Exception($"{rIpEndPoint}", e); } }
public void Initialize(NetworkProtocol rProtocol) { this.OpcodeTypes = new NetworkOpcodeTypes(); this.OpcodeTypes.Initialize(); this.MessageDispatcher = new NetworkClientDispatcher(); this.MessagePacker = new NetworkMessagePacker(); switch (rProtocol) { case NetworkProtocol.TCP: this.mService = new TService(); break; case NetworkProtocol.KCP: this.mService = new KService(); break; default: throw new ArgumentOutOfRangeException(); } }
protected AChannel(AService rService, ChannelType rChannelType) { this.ChannelType = rChannelType; this.mService = rService; }