- if (connectionHandler == null) {
- return;
- }
- FcpUtils.close(remoteSocket);
- connectionHandler.stop();
- connectionHandler = null;
- fireConnectionClosed();
+ close();
+ }
+
+ /**
+ * Closes the connection. If there is no connection to the node, this method
+ * does nothing.
+ */
+ public void close() {
+ handleDisconnect(null);