public override void Shutdown() { channelNameToId.Clear(); connections.Clear(); // Release to GC messageBuffer = null; if (socket != null && socket.IsInitialized) { // Releases memory and other things socket.Shutdown(); } // Release to GC socket = null; // Release server connection to GC serverConnection = null; }