-
Notifications
You must be signed in to change notification settings - Fork 0
Client class
Matěj Bucek edited this page Mar 18, 2020
·
1 revision
This class handles connection to your JDTP Server.
Needs 3 parameters:
- String IP Address
- int Port
- 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);
Matěj Bucek © 2020 mBucek.cz