Interface WebSocketProtocolHandler
A WebSocket protocol handler for
WebSocketService
.-
Method Summary
Modifier and TypeMethodDescriptiondecode
(ServiceRequestContext ctx, HttpRequest req) Decodes the specifiedHttpRequest
to aWebSocket
.encode
(ServiceRequestContext ctx, WebSocket out) Encodes the specifiedWebSocket
to anHttpResponse
.upgrade
(ServiceRequestContext ctx, HttpRequest req) Upgrades the givenHttpRequest
to aWebSocket
.
-
Method Details
-
upgrade
Upgrades the givenHttpRequest
to aWebSocket
.If the upgrade succeeds,
WebSocketUpgradeResult.ofSuccess()
is returned. If the upgrade fails,WebSocketUpgradeResult.ofFailure(HttpResponse)
is returned.- Throws:
Exception
-
decode
Decodes the specifiedHttpRequest
to aWebSocket
. -
encode
Encodes the specifiedWebSocket
to anHttpResponse
.
-