1 package be
.nikiroo
.utils
.serial
.server
;
3 import java
.io
.IOException
;
4 import java
.net
.Socket
;
6 import be
.nikiroo
.utils
.Version
;
9 * Class used for the server basic handling.
11 * It represents a single action: a server is expected to execute one action for
16 public class ConnectActionServerString
extends ConnectActionServer
{
18 * Create a new {@link ConnectActionServerString} with the current
19 * application version (see {@link Version#getCurrentVersion()}) as the
23 * the socket to bind to
25 public ConnectActionServerString(Socket s
) {
30 * Create a new {@link ConnectActionServerString}.
33 * the socket to bind to
37 public ConnectActionServerString(Socket s
, Version version
) {
42 * Serialise and send the given object to the client.
48 * in case of I/O error
50 public void send(String data
) throws IOException
{
51 action
.sendString(data
);
55 * (Flush the data to the client if needed and) retrieve its answer.
57 * @return the answer if it is available, or NULL if not
60 * in case of I/O error
62 public String
rec() throws IOException
{
63 return action
.recString();