Module technology.sola.engine
Interface SocketClient
- All Known Implementing Classes:
JavaSocketClient
@NullMarked
public interface SocketClient
SocketClient defines the api for interacting with a socket server.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Connects to a server by host and port.void
Disconnect from the server.boolean
void
sendMessage
(SocketMessage socketMessage) Sends a message to the server.
-
Method Details
-
getNetworkQueue
NetworkQueue<SocketMessage> getNetworkQueue()- Returns:
- the queue of messages from the server
-
sendMessage
Sends a message to the server.- Parameters:
socketMessage
- theSocketMessage
to send
-
connect
Connects to a server by host and port.- Parameters:
host
- the host of the serverport
- the port accepting connections
-
disconnect
void disconnect()Disconnect from the server. -
isConnected
boolean isConnected()- Returns:
- true if connected to a server
-