Interface ServerConnection
- All Known Subinterfaces:
CrossfireServerConnection
- All Known Implementing Classes:
AbstractCrossfireServerConnection,DefaultCrossfireServerConnection,DefaultServerConnection
public interface ServerConnection
Performs most of the network-related work.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddClientSocketListener(@NotNull ClientSocketListener clientSocketListener) Adds aClientSocketListenerto notify.voidAttempts to connect the client to a server.voiddisconnect(@NotNull String reason) Disconnects from the server.voidremoveClientSocketListener(@NotNull ClientSocketListener clientSocketListener) Removes aClientSocketListenerto notify.
-
Method Details
-
connect
Attempts to connect the client to a server.- Parameters:
hostname- the hostname to connect toport- the port to connect to
-
disconnect
Disconnects from the server. Does nothing if not connected.- Parameters:
reason- the reason for the disconnect
-
addClientSocketListener
Adds aClientSocketListenerto notify.- Parameters:
clientSocketListener- the client socket listener to add
-
removeClientSocketListener
Removes aClientSocketListenerto notify.- Parameters:
clientSocketListener- the client socket listener to remove
-