Interface SocketClient

All Known Implementing Classes:
JavaSocketClient

@NullMarked public interface SocketClient
SocketClient defines the api for interacting with a socket server.
  • Method Details

    • getNetworkQueue

      NetworkQueue<SocketMessage> getNetworkQueue()
      Returns:
      the queue of messages from the server
    • sendMessage

      void sendMessage(SocketMessage socketMessage)
      Sends a message to the server.
      Parameters:
      socketMessage - the SocketMessage to send
    • connect

      void connect(String host, int port)
      Connects to a server by host and port.
      Parameters:
      host - the host of the server
      port - the port accepting connections
    • disconnect

      void disconnect()
      Disconnect from the server.
    • isConnected

      boolean isConnected()
      Returns:
      true if connected to a server