com.realtime.crossfire.jxclient.server.server
Interface ServerConnection

All Known Subinterfaces:
CrossfireServerConnection
All Known Implementing Classes:
DefaultCrossfireServerConnection, DefaultServerConnection

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

addClientSocketListener

void addClientSocketListener(@NotNull
                             ClientSocketListener clientSocketListener)
Adds a ClientSocketListener to notify.

Parameters:
clientSocketListener - the client socket listener to add

connect

void connect(@NotNull
             java.lang.String hostname,
             int port)
Attempts to connect the client to a server.

Parameters:
hostname - the hostname to connect to
port - the port to connect to

disconnect

void disconnect(@NotNull
                java.lang.String reason)
Disconnects from the server. Does nothing if not connected.

Parameters:
reason - the reason for the disconnect

removeClientSocketListener

void removeClientSocketListener(@NotNull
                                ClientSocketListener clientSocketListener)
Removes a ClientSocketListener to notify.

Parameters:
clientSocketListener - the client socket listener to remove