Nakama .NET Client SDK 3.8.0
Nakama .NET Client SDK
Loading...
Searching...
No Matches
Nakama.Ninja.WebSockets.IWebSocketServerFactory Interface Reference

Web socket server factory used to open web socket server connections. More...

Inheritance diagram for Nakama.Ninja.WebSockets.IWebSocketServerFactory:
Nakama.Ninja.WebSockets.WebSocketServerFactory

Public Member Functions

Task< WebSocketHttpContextReadHttpHeaderFromStreamAsync (System.IO.Stream stream, CancellationToken token=default(CancellationToken))
 Reads a http header information from a stream and decodes the parts relating to the WebSocket protocot upgrade.
 
Task< WebSocket > AcceptWebSocketAsync (WebSocketHttpContext context, CancellationToken token=default(CancellationToken))
 Accept web socket with default options Call ReadHttpHeaderFromStreamAsync first to get WebSocketHttpContext.
 
Task< WebSocket > AcceptWebSocketAsync (WebSocketHttpContext context, WebSocketServerOptions options, CancellationToken token=default(CancellationToken))
 Accept web socket with options specified Call ReadHttpHeaderFromStreamAsync first to get WebSocketHttpContext.
 

Detailed Description

Web socket server factory used to open web socket server connections.

Member Function Documentation

◆ AcceptWebSocketAsync() [1/2]

Task< WebSocket > Nakama.Ninja.WebSockets.IWebSocketServerFactory.AcceptWebSocketAsync ( WebSocketHttpContext  context,
CancellationToken  token = default(CancellationToken) 
)

Accept web socket with default options Call ReadHttpHeaderFromStreamAsync first to get WebSocketHttpContext.

Parameters
contextThe http context used to initiate this web socket request
tokenThe optional cancellation token
Returns
A connected web socket

Implemented in Nakama.Ninja.WebSockets.WebSocketServerFactory.

◆ AcceptWebSocketAsync() [2/2]

Task< WebSocket > Nakama.Ninja.WebSockets.IWebSocketServerFactory.AcceptWebSocketAsync ( WebSocketHttpContext  context,
WebSocketServerOptions  options,
CancellationToken  token = default(CancellationToken) 
)

Accept web socket with options specified Call ReadHttpHeaderFromStreamAsync first to get WebSocketHttpContext.

Parameters
contextThe http context used to initiate this web socket request
optionsThe web socket options
tokenThe optional cancellation token
Returns
A connected web socket

Implemented in Nakama.Ninja.WebSockets.WebSocketServerFactory.

◆ ReadHttpHeaderFromStreamAsync()

Task< WebSocketHttpContext > Nakama.Ninja.WebSockets.IWebSocketServerFactory.ReadHttpHeaderFromStreamAsync ( System.IO.Stream  stream,
CancellationToken  token = default(CancellationToken) 
)

Reads a http header information from a stream and decodes the parts relating to the WebSocket protocot upgrade.

Parameters
streamThe network stream
tokenThe optional cancellation token
Returns
Http data read from the stream

Implemented in Nakama.Ninja.WebSockets.WebSocketServerFactory.


The documentation for this interface was generated from the following file: