protected void Awake(NetworkProtocol protocol) { switch (protocol) { case NetworkProtocol.TCP: this.Service = new TService(); break; case NetworkProtocol.UDP: this.Service = new UService(); break; default: throw new ArgumentOutOfRangeException(); } }
private void Dispose(bool disposing) { if (this.service == null) { return; } base.Dispose(); if (disposing) { this.service.Dispose(); } this.service = null; }
protected void Awake(NetworkProtocol protocol, string host, int port) { switch (protocol) { case NetworkProtocol.TCP: this.Service = new TService(host, port); break; case NetworkProtocol.UDP: this.Service = new UService(host, port); break; default: throw new ArgumentOutOfRangeException(); } this.StartAccept(); }
public void Awake(NetworkProtocol protocol) { switch (protocol) { case NetworkProtocol.TCP: this.service = new TService { OnError = this.OnError }; break; case NetworkProtocol.UDP: this.service = new UService { OnError = this.OnError }; break; default: throw new ArgumentOutOfRangeException(); } }
protected AChannel(AService service) { this.Id = IdGenerater.GenerateId(); this.service = service; }
protected AChannel(AService service, ChannelType channelType) { this.Id = IdGenerater.GenerateId(); this.ChannelType = channelType; this.service = service; }