mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Возможность отправки сообщений по Channel
This commit is contained in:
parent
8c62cfff11
commit
773981c32f
1 changed files with 8 additions and 0 deletions
|
@ -133,6 +133,14 @@ public void sendObject(ChannelHandlerContext ctx, Object obj, Type type) {
|
|||
ctx.writeAndFlush(new TextWebSocketFrame(gson.toJson(obj, type)), ctx.voidPromise());
|
||||
}
|
||||
|
||||
public void sendObject(Channel channel, Object obj) {
|
||||
channel.writeAndFlush(new TextWebSocketFrame(gson.toJson(obj, WebSocketEvent.class)), channel.voidPromise());
|
||||
}
|
||||
|
||||
public void sendObject(Channel channel, Object obj, Type type) {
|
||||
channel.writeAndFlush(new TextWebSocketFrame(gson.toJson(obj, type)), channel.voidPromise());
|
||||
}
|
||||
|
||||
public void sendObjectAll(Object obj) {
|
||||
for (Channel ch : channels) {
|
||||
ch.writeAndFlush(new TextWebSocketFrame(gson.toJson(obj, WebSocketEvent.class)), ch.voidPromise());
|
||||
|
|
Loading…
Reference in a new issue