-
Notifications
You must be signed in to change notification settings - Fork 0
ClientEndPoint interface
Matěj Bucek edited this page Mar 18, 2020
·
1 revision
This is a Client EndPoint interface. You will receive all data and info there.
You shouldn't use EndPoint annotation here.
Example:
public class ClientEP implements ClientEndPoint{
public void onOpen(Client client) {
System.out.println("Client: open");
try {
client.sendString("Hi");
} catch (IOException e) {
e.printStackTrace();
}
}
public void onMessage(Client client, Message message) {
System.out.println("Server: " + message.getString());
}
public void onError(Client client, Error error) {
System.out.println("Error");
}
public void onClose(Client client) {
System.out.println("Client close");
}
}
Matěj Bucek © 2020 mBucek.cz