public void Terminate() { this.terminated = true; foreach (var socket in sockets.Values) { lock (this.synclock) { socket.Dispose(); } } sockets.Clear(); this.Context.Dispose(); } }