Module technology.sola.engine
Class JavaSocketClient
java.lang.Object
technology.sola.engine.networking.socket.JavaSocketClient
- All Implemented Interfaces:
SocketClient
A Java-based implementation of
SocketClient utilizing Socket.-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
JavaSocketClient
public JavaSocketClient()
-
-
Method Details
-
getNetworkQueue
- Specified by:
getNetworkQueuein interfaceSocketClient- Returns:
- the queue of messages from the server
-
sendMessage
Description copied from interface:SocketClientSends a message to the server.- Specified by:
sendMessagein interfaceSocketClient- Parameters:
socketMessage- theSocketMessageto send
-
connect
Description copied from interface:SocketClientConnects to a server by host and port.- Specified by:
connectin interfaceSocketClient- Parameters:
host- the host of the serverport- the port accepting connections
-
disconnect
public void disconnect()Description copied from interface:SocketClientDisconnect from the server.- Specified by:
disconnectin interfaceSocketClient
-
isConnected
public boolean isConnected()- Specified by:
isConnectedin interfaceSocketClient- Returns:
- true if connected to a server
-