}
}
+ /**
+ * Notifies all listeners that the connection to the node was closed.
+ *
+ * @see FcpListener#connectionClosed(FcpConnection)
+ */
+ private void fireConnectionClosed() {
+ for (FcpListener fcpListener: fcpListeners) {
+ fcpListener.connectionClosed(this);
+ }
+ }
+
//
// ACTIONS
//
Closer.close(remoteOutputStream);
Closer.close(remoteSocket);
connectionHandler = null;
+ fireConnectionClosed();
}
//
*/
public void receivedMessage(FcpConnection fcpConnection, FcpMessage fcpMessage);
+ /**
+ * Notifies a listener that a connection was closed. A closed connection can
+ * be reestablished by calling {@link FcpConnection#connect()} on the same
+ * object again.
+ *
+ * @param fcpConnection
+ * The connection that was closed.
+ */
+ public void connectionClosed(FcpConnection fcpConnection);
+
}