public void Dispose() { if (!needsDisposing) { return; } UDP.Destroy(ref socket); needsDisposing = false; }