public ServerHost(Address address, uint peerLimit = NativeMethods.ENET_PROTOCOL_MAXIMUM_PEER_ID, uint channelLimit = 0, uint incomingBandwidth = 0, uint outgoingBandwidth = 0, bool enableCrc = true) { if (peerLimit > NativeMethods.ENET_PROTOCOL_MAXIMUM_PEER_ID) { throw new ArgumentOutOfRangeException("peerLimit"); } CheckChannelLimit(channelLimit); ENetAddress nativeAddress = address.Struct; this.host = NativeMethods.enet_host_create( ref nativeAddress, peerLimit, channelLimit, incomingBandwidth, outgoingBandwidth); if (this.host == IntPtr.Zero) { throw new ENetException(0, "Host creation call failed."); } if (enableCrc) { NativeMethods.enet_enable_crc(this.host); } }
protected void EnableCrc() { NativeMethods.enet_enable_crc(this.host); }