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 ConnectActionClientObject
extends ConnectActionClient
{
17 * Create a new {@link ConnectActionClientObject} .
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 ConnectActionClientObject(Socket s
, String key
) {
30 * Create a new {@link ConnectActionClientObject}.
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 ConnectActionClientObject(String host
, int port
, String key
)
50 super(host
, port
, key
);
54 * Serialise and send the given object to the server (and return the
55 * deserialised answer).
60 * @return the answer, which can be NULL
63 * in case of I/O error
64 * @throws NoSuchFieldException
65 * if the serialised data contains information about a field
66 * which does actually not exist in the class we know of
67 * @throws NoSuchMethodException
68 * if a class described in the serialised data cannot be created
69 * because it is not compatible with this code
70 * @throws ClassNotFoundException
71 * if a class described in the serialised data cannot be found
73 public Object
send(Object data
) throws IOException
, NoSuchFieldException
,
74 NoSuchMethodException
, ClassNotFoundException
{
75 return action
.sendObject(data
);