Skip to content

Client class

Matěj Bucek edited this page Mar 18, 2020 · 1 revision

Client class

This class handles connection to your JDTP Server.

Needs 3 parameters:

  1. String IP Address
  2. int Port
  3. String EndPoint

Client client = new Client("localhost", 8080, "/");

Methods:

  • Connect - Starts connection to server.

client.connect();

  • Close - Closes the connection.

client.close();

  • Set ClientEndPoint - Set the client EndPoint.

client.setEndPoint(ClientEndPoint);

  • Send String - Sends string to server.

client.sendString("Message");

  • Send Bytes - Sends bytes to server.

client.sendBytes(byte[]);

  • Send Object - Sends your object to the server. (Works just with classes, which implements Serializable class)

client.sendObject(Object);

Clone this wiki locally