Interface ServerConnection

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

public interface ServerConnection
Performs most of the network-related work.
  • Method Details

    • connect

      void connect(@NotNull @NotNull 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 @NotNull String reason)
      Disconnects from the server. Does nothing if not connected.
      Parameters:
      reason - the reason for the disconnect
    • addClientSocketListener

      void addClientSocketListener(@NotNull @NotNull ClientSocketListener clientSocketListener)
      Adds a ClientSocketListener to notify.
      Parameters:
      clientSocketListener - the client socket listener to add
    • removeClientSocketListener

      void removeClientSocketListener(@NotNull @NotNull ClientSocketListener clientSocketListener)
      Removes a ClientSocketListener to notify.
      Parameters:
      clientSocketListener - the client socket listener to remove