public NetworkChannel(string name, INetworkHandler handler, INetworkEncoder encoder, INetworkDecoder decoder) { Name = name; m_Handler = handler; m_Encoder = encoder; m_Decoder = decoder; m_ReceiveBuffer.SetLength(m_ReceiveBuffer.Capacity); }
public INetworkChannel CreateChannel(string channelName, INetworkHandler handler, INetworkEncoder encoder, INetworkDecoder decoder) { if (HasChannel(channelName)) { throw new DrbException("already exist channel '{0}'", channelName); } INetworkChannel channel = new NetworkChannel(channelName, handler, encoder, decoder); m_ChannelDic[channelName] = channel; return(channel); }