Class ServerOutput
java.lang.Object
za.co.wethinkcode.robots.server.networking.ServerOutput
- All Implemented Interfaces:
AutoCloseable
The Server Output Class is solely responsible for the networking component of the server output
-
Constructor Summary
ConstructorsConstructorDescriptionServerOutput(Socket socket) Standard Constructor for the server Output Object -
Method Summary
-
Constructor Details
-
ServerOutput
Standard Constructor for the server Output Object- Parameters:
socket- the socket this server output is being connected to- Throws:
IOException- fails to be constructed if there is a flaw in the socket design
-
-
Method Details
-
send
public void send(com.google.gson.JsonObject json) The send message is the final state of validation that the message being sent over the network adheres to the Robot World API specStrings are cleaned with
ServerAPI.cleanForNetworkRaw(String)- Parameters:
json- the json Object being sent over the network
-
send
A raw string being sent over the network. Mostly used for utility purposes.Strings are cleaned with
ServerAPI.cleanForNetworkRaw(String) -
close
public void close()Close an output- Specified by:
closein interfaceAutoCloseable
-