public interface ServerConnection
Performs most of the network-related work.
Method Summary | |
---|---|
void |
addClientSocketListener(ClientSocketListener clientSocketListener)
Adds a ClientSocketListener to notify. |
void |
connect(java.lang.String hostname,
int port)
Attempts to connect the client to a server. |
void |
disconnect(java.lang.String reason)
Disconnects from the server. |
void |
removeClientSocketListener(ClientSocketListener clientSocketListener)
Removes a ClientSocketListener to notify. |
Method Detail |
---|
void addClientSocketListener(@NotNull ClientSocketListener clientSocketListener)
ClientSocketListener
to notify.
clientSocketListener
- the client socket listener to addvoid connect(@NotNull java.lang.String hostname, int port)
hostname
- the hostname to connect toport
- the port to connect tovoid disconnect(@NotNull java.lang.String reason)
reason
- the reason for the disconnectvoid removeClientSocketListener(@NotNull ClientSocketListener clientSocketListener)
ClientSocketListener
to notify.
clientSocketListener
- the client socket listener to remove