Interface WebSocketService
- All Superinterfaces:
HttpService
,Service<HttpRequest,
,HttpResponse> Unwrappable
An
HttpService
that supports
The WebSocket Protocol.
This service has a few different default values for ServiceConfig
from a normal HttpService
because of the nature of WebSocket. See WebSocketServiceBuilder
for more information.-
Method Summary
Modifier and TypeMethodDescriptionstatic WebSocketServiceBuilder
builder
(WebSocketServiceHandler handler) Returns a newWebSocketServiceBuilder
with theWebSocketServiceHandler
.static WebSocketService
of
(WebSocketServiceHandler handler) Returns a newWebSocketService
with theWebSocketServiceHandler
.default ServiceOptions
options()
Returns theServiceOptions
of thisHttpService
.Returns theWebSocketProtocolHandler
of this service.default HttpResponse
serve
(ServiceRequestContext ctx, HttpRequest req) Serves an incomingRequest
.serve
(ServiceRequestContext ctx, WebSocket in) Methods inherited from interface com.linecorp.armeria.server.HttpService
decorate, decorate, exchangeType
Methods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, shouldCachePath, unwrap
Methods inherited from interface com.linecorp.armeria.common.util.Unwrappable
equalsIgnoreWrapper, unwrapAll
-
Method Details
-
of
Returns a newWebSocketService
with theWebSocketServiceHandler
. -
builder
Returns a newWebSocketServiceBuilder
with theWebSocketServiceHandler
. -
serve
Description copied from interface:Service
Serves an incomingRequest
.- Specified by:
serve
in interfaceHttpService
- Specified by:
serve
in interfaceService<HttpRequest,
HttpResponse> - Parameters:
ctx
- the context of the receivedRequest
req
- the receivedRequest
- Returns:
- the
Response
- Throws:
Exception
-
serve
- Throws:
Exception
-
protocolHandler
WebSocketProtocolHandler protocolHandler()Returns theWebSocketProtocolHandler
of this service. -
options
Description copied from interface:HttpService
Returns theServiceOptions
of thisHttpService
.- Specified by:
options
in interfaceHttpService
-