1 package be
.nikiroo
.utils
.serial
.server
;
3 import java
.io
.IOException
;
4 import java
.net
.Socket
;
5 import java
.net
.UnknownHostException
;
8 * Class used for the client basic handling.
10 * It represents a single action: a client is expected to only execute one
15 public class ConnectActionClientString
extends ConnectActionClient
{
17 * Create a new {@link ConnectActionClientString}.
20 * the socket to bind to
22 * an optional key to encrypt all the communications (if NULL,
23 * everything will be sent in clear text)
25 public ConnectActionClientString(Socket s
, String key
) {
30 * Create a new {@link ConnectActionClientString}.
37 * an optional key to encrypt all the communications (if NULL,
38 * everything will be sent in clear text)
41 * in case of I/O error
42 * @throws UnknownHostException
43 * if the IP address of the host could not be determined
44 * @throws IllegalArgumentException
45 * if the port parameter is outside the specified range of valid
46 * port values, which is between 0 and 65535, inclusive
48 public ConnectActionClientString(String host
, int port
, String key
)
50 super(host
, port
, key
);
54 * Send the given object to the server (and return the answer).
59 * @return the answer, which can be NULL
62 * in case of I/O error
64 public String
send(String data
) throws IOException
{
65 return action
.sendString(data
);