public final class WebsocketSession extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CONTENT_TYPE |
static int |
STATUS_CODE_NORMAL_CLOSE |
| Constructor and Description |
|---|
WebsocketSession(reactor.ipc.netty.http.server.HttpServerRequest httpRequest,
reactor.ipc.netty.http.websocket.WebsocketInbound inbound,
reactor.ipc.netty.http.websocket.WebsocketOutbound outbound)
Create a new websocket session with given handshake, inbound and outbound channels.
|
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Mono<Void> |
close()
Close the websocket session with normal status.
|
boolean |
containsSid(Long streamId) |
String |
contentType() |
boolean |
dispose(Long streamId)
Disposing stored subscription by given stream id.
|
String |
id() |
void |
onClose(Runnable runnable)
Lambda setter for reacting on channel close occurence.
|
reactor.core.publisher.Flux<io.netty.buffer.ByteBuf> |
receive()
Method for receiving request messages coming a form of websocket frames.
|
boolean |
register(Long streamId,
reactor.core.Disposable disposable)
Saves (if not already saved) by stream id a subscrption of service call coming in form of
Disposable reference. |
reactor.core.publisher.Mono<Void> |
send(org.reactivestreams.Publisher<io.netty.buffer.ByteBuf> publisher)
Method for send replies which taken in a form of publisher of byte buffers.
|
String |
toString() |
public static final String DEFAULT_CONTENT_TYPE
public static final int STATUS_CODE_NORMAL_CLOSE
public WebsocketSession(reactor.ipc.netty.http.server.HttpServerRequest httpRequest,
reactor.ipc.netty.http.websocket.WebsocketInbound inbound,
reactor.ipc.netty.http.websocket.WebsocketOutbound outbound)
httpRequest - - Init session HTTP requestinbound - - Websocket inboundoutbound - - Websocket outboundpublic String id()
public String contentType()
public reactor.core.publisher.Flux<io.netty.buffer.ByteBuf> receive()
ByteBufpublic reactor.core.publisher.Mono<Void> send(org.reactivestreams.Publisher<io.netty.buffer.ByteBuf> publisher)
publisher - byte buf publisherpublic reactor.core.publisher.Mono<Void> close()
public void onClose(Runnable runnable)
runnable - lambdapublic boolean dispose(Long streamId)
streamId - stream idpublic boolean containsSid(Long streamId)
public boolean register(Long streamId, reactor.core.Disposable disposable)
Disposable reference.streamId - stream iddisposable - service subscrptionCopyright © 2015–2018. All rights reserved.