Closes the socket.
@override Future<void> dispose() async { heartbeatTimer?.cancel(); await super.dispose(); }