public void Dispose() { if (Pointer == IntPtr.Zero) { return; } try { StopServiceThread(); } catch { } if (Compressor != null) { Compressor.Dispose(); Compressor = null; } if (Checksum != null) { Checksum.Dispose(); Checksum = null; } if (Interceptor != null) { Interceptor.Dispose(); Interceptor = null; } m_Peers.ForEach(p => p.FreeHandle()); LibENet.HostDestroy(Pointer); Pointer = IntPtr.Zero; }
public void ChecksumWithCRC32() { CheckDispose(); if (Checksum != null) { Checksum.Dispose(); Checksum = null; } *m_pChecksumCallback = LibENet.GetProc("enet_crc32"); }
public void DoNotChecksum() { CheckDispose(); if (Checksum != null) { Checksum.Dispose(); Checksum = null; } *m_pChecksumCallback = IntPtr.Zero; }
public void ChecksumWith(ENetChecksum checksum) { CheckDispose(); if (checksum.Host != null && checksum.Host != this) { throw new Exception("Checksum is already in-use by another host."); } if (Checksum != null) { Checksum.Dispose(); Checksum = null; } Checksum = checksum; *m_pChecksumCallback = Marshal.GetFunctionPointerForDelegate(ChecksumDelegate); }