public interface ServerConnection
Modifier and Type | Method and Description |
---|---|
void |
addClientSocketListener(@NotNull ClientSocketListener clientSocketListener)
Adds a
ClientSocketListener to notify. |
void |
connect(@NotNull java.lang.String hostname,
int port)
Attempts to connect the client to a server.
|
void |
disconnect(@NotNull java.lang.String reason)
Disconnects from the server.
|
void |
removeClientSocketListener(@NotNull ClientSocketListener clientSocketListener)
Removes a
ClientSocketListener to notify. |
void connect(@NotNull @NotNull java.lang.String hostname, int port)
hostname
- the hostname to connect toport
- the port to connect tovoid disconnect(@NotNull @NotNull java.lang.String reason)
reason
- the reason for the disconnectvoid addClientSocketListener(@NotNull @NotNull ClientSocketListener clientSocketListener)
ClientSocketListener
to notify.clientSocketListener
- the client socket listener to addvoid removeClientSocketListener(@NotNull @NotNull ClientSocketListener clientSocketListener)
ClientSocketListener
to notify.clientSocketListener
- the client socket listener to remove