1 package be
.nikiroo
.utils
.serial
.server
;
3 import java
.io
.IOException
;
4 import java
.net
.Socket
;
7 * Class used for the server basic handling.
9 * It represents a single action: a server is expected to execute one action for
14 public class ConnectActionServerString
extends ConnectActionServer
{
16 * Create a new {@link ConnectActionServerString} as the server version.
19 * the socket to bind to
21 * an optional key to encrypt all the communications (if NULL,
22 * everything will be sent in clear text)
24 public ConnectActionServerString(Socket s
, String key
) {
29 * Serialise and send the given object to the client.
35 * in case of I/O error
37 public void send(String data
) throws IOException
{
38 action
.sendString(data
);
42 * (Flush the data to the client if needed and) retrieve its answer.
44 * @return the answer if it is available, or NULL if not
47 * in case of I/O error
49 public String
rec() throws IOException
{
50 return action
.recString();