Package pro.gravit.launchserver.socket
Class WebSocketService
java.lang.Object
pro.gravit.launchserver.socket.WebSocketService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal io.netty.channel.group.ChannelGroupfinal pro.gravit.utils.BiHookSet<WebSocketService.WebSocketRequestContext,io.netty.channel.ChannelHandlerContext> final AtomicLongfinal AtomicLongfinal AtomicLongfinal AtomicLongfinal AtomicLongstatic final pro.gravit.utils.ProviderMap<WebSocketServerResponse>final AtomicLongfinal AtomicLong -
Constructor Summary
ConstructorsConstructorDescriptionWebSocketService(io.netty.channel.group.ChannelGroup channels, LaunchServer server) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequestTimeToStats(long nanos) voidforEachActiveChannels(BiConsumer<io.netty.channel.Channel, WebSocketFrameHandler> callback) io.netty.channel.ChannelgetChannelFromConnectUUID(UUID connectUuid) static StringgetIPFromChannel(io.netty.channel.Channel channel) static StringgetIPFromContext(io.netty.channel.ChannelHandlerContext ctx) booleankickByConnectUUID(UUID connectUuid, boolean isClose) booleanbooleankickByUserUUID(UUID userUuid, boolean isClose) voidprocess(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.websocketx.TextWebSocketFrame frame, Client client, String ip) voidregisterClient(io.netty.channel.Channel channel) static voidvoidDeprecated.voidsendObject(io.netty.channel.ChannelHandlerContext ctx, Object obj) voidsendObject(io.netty.channel.ChannelHandlerContext ctx, Object obj, Type type) voidsendObject(io.netty.channel.Channel channel, Object obj) voidsendObject(io.netty.channel.Channel channel, Object obj, Type type) voidsendObjectAll(Object obj) voidsendObjectAll(Object obj, Type type) voidsendObjectAndClose(io.netty.channel.ChannelHandlerContext ctx, Object obj) voidsendObjectAndClose(io.netty.channel.ChannelHandlerContext ctx, Object obj, Type type) voidsendObjectToUUID(UUID userUuid, Object obj, Type type)
-
Field Details
-
providers
-
channels
public final io.netty.channel.group.ChannelGroup channels -
hook
public final pro.gravit.utils.BiHookSet<WebSocketService.WebSocketRequestContext,io.netty.channel.ChannelHandlerContext> hook -
shortRequestLatency
-
shortRequestCounter
-
middleRequestLatency
-
middleRequestCounter
-
longRequestLatency
-
longRequestCounter
-
lastRequestTime
-
-
Constructor Details
-
WebSocketService
-
-
Method Details
-
registerResponses
public static void registerResponses() -
forEachActiveChannels
public void forEachActiveChannels(BiConsumer<io.netty.channel.Channel, WebSocketFrameHandler> callback) -
process
-
addRequestTimeToStats
public void addRequestTimeToStats(long nanos) -
registerClient
public void registerClient(io.netty.channel.Channel channel) -
getIPFromContext
-
getIPFromChannel
-
sendObject
-
sendObject
-
sendObject
-
sendObject
-
sendObjectAll
-
sendObjectAll
-
sendObjectToUUID
-
getChannelFromConnectUUID
-
kickByUserUUID
-
kickByConnectUUID
-
kickByIP
-
sendObjectAndClose
-
sendObjectAndClose
-
sendEvent
Deprecated.
-