mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-01 22:14:01 +03:00
Make send methods.
This commit is contained in:
parent
90dbe66834
commit
cc7a5b357b
1 changed files with 11 additions and 4 deletions
|
@ -1,8 +1,7 @@
|
|||
package ru.gravit.launcher.request.websockets;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.io.Reader;
|
||||
|
||||
import javax.websocket.ClientEndpoint;
|
||||
import javax.websocket.OnError;
|
||||
|
@ -50,11 +49,19 @@ public void processError(final Throwable t) {
|
|||
}
|
||||
|
||||
@OnMessage
|
||||
public void processMessage(final String message) {
|
||||
public void processMessage(Reader message) {
|
||||
try {
|
||||
JsonValue json = Json.parse(message);
|
||||
} catch (ParseException ex) {
|
||||
} catch (ParseException | IOException ex) {
|
||||
LogHelper.error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void send(JsonValue js) throws IOException {
|
||||
session.getBasicRemote().sendText(js.asString());
|
||||
}
|
||||
|
||||
public void sendAsync(JsonValue js) throws IOException {
|
||||
session.getAsyncRemote().sendText(js.asString());
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue