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 TypeMethodDescriptionvoidConnects to a server by host and port.voidDisconnect from the server.booleanvoidsendMessage(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- theSocketMessageto 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
-