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 WebSocketServiceBuilderbuilder(WebSocketServiceHandler handler) Returns a newWebSocketServiceBuilderwith theWebSocketServiceHandler.static WebSocketServiceof(WebSocketServiceHandler handler) Returns a newWebSocketServicewith theWebSocketServiceHandler.default ServiceOptionsoptions()Returns theServiceOptionsof thisHttpService.Returns theWebSocketProtocolHandlerof this service.default HttpResponseserve(ServiceRequestContext ctx, HttpRequest req) Serves an incomingRequest.serve(ServiceRequestContext ctx, WebSocket in) Methods inherited from interface com.linecorp.armeria.server.HttpService
decorate, decorate, exchangeTypeMethods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, shouldCachePath, unwrapMethods inherited from interface com.linecorp.armeria.common.util.Unwrappable
equalsIgnoreWrapper, unwrapAll
-
Method Details
-
of
Returns a newWebSocketServicewith theWebSocketServiceHandler. -
builder
Returns a newWebSocketServiceBuilderwith theWebSocketServiceHandler. -
serve
Description copied from interface:ServiceServes an incomingRequest.- Specified by:
servein interfaceHttpService- Specified by:
servein interfaceService<HttpRequest,HttpResponse> - Parameters:
ctx- the context of the receivedRequestreq- the receivedRequest- Returns:
- the
Response - Throws:
Exception
-
serve
- Throws:
Exception
-
protocolHandler
WebSocketProtocolHandler protocolHandler()Returns theWebSocketProtocolHandlerof this service. -
options
Description copied from interface:HttpServiceReturns theServiceOptionsof thisHttpService.- Specified by:
optionsin interfaceHttpService
-