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

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

Inheritance diagram for Nakama.Ninja.WebSockets.IWebSocketClientFactory:
Nakama.Ninja.WebSockets.WebSocketClientFactory

Public Member Functions

Task< WebSocket > ConnectAsync (Uri uri, CancellationToken token=default(CancellationToken))
 Connect with default options.
 
Task< WebSocket > ConnectAsync (Uri uri, WebSocketClientOptions options, CancellationToken token=default(CancellationToken))
 Connect with options specified.
 
Task< WebSocket > ConnectAsync (System.IO.Stream responseStream, string secWebSocketKey, WebSocketClientOptions options, CancellationToken token=default(CancellationToken))
 Connect with a stream that has already been opened and HTTP websocket upgrade request sent This function will check the handshake response from the server and proceed if successful Use this function if you have specific requirements to open a conenction like using special http headers and cookies You will have to build your own HTTP websocket upgrade request You may not even choose to use TCP/IP and this function will allow you to do that.
 

Detailed Description

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

Member Function Documentation

◆ ConnectAsync() [1/3]

Task< WebSocket > Nakama.Ninja.WebSockets.IWebSocketClientFactory.ConnectAsync ( System.IO.Stream  responseStream,
string  secWebSocketKey,
WebSocketClientOptions  options,
CancellationToken  token = default(CancellationToken) 
)

Connect with a stream that has already been opened and HTTP websocket upgrade request sent This function will check the handshake response from the server and proceed if successful Use this function if you have specific requirements to open a conenction like using special http headers and cookies You will have to build your own HTTP websocket upgrade request You may not even choose to use TCP/IP and this function will allow you to do that.

Parameters
responseStreamThe full duplex response stream from the server
secWebSocketKeyThe secWebSocketKey you used in the handshake request
optionsThe WebSocket client options
tokenThe optional cancellation token
Returns

Implemented in Nakama.Ninja.WebSockets.WebSocketClientFactory.

◆ ConnectAsync() [2/3]

Task< WebSocket > Nakama.Ninja.WebSockets.IWebSocketClientFactory.ConnectAsync ( Uri  uri,
CancellationToken  token = default(CancellationToken) 
)

Connect with default options.

Parameters
uriThe WebSocket uri to connect to (e.g. ws://example.com or wss://example.com for SSL)
tokenThe optional cancellation token
Returns
A connected web socket instance

Implemented in Nakama.Ninja.WebSockets.WebSocketClientFactory.

◆ ConnectAsync() [3/3]

Task< WebSocket > Nakama.Ninja.WebSockets.IWebSocketClientFactory.ConnectAsync ( Uri  uri,
WebSocketClientOptions  options,
CancellationToken  token = default(CancellationToken) 
)

Connect with options specified.

Parameters
uriThe WebSocket uri to connect to (e.g. ws://example.com or wss://example.com for SSL)
optionsThe WebSocket client options
tokenThe optional cancellation token
Returns
A connected web socket instance

Implemented in Nakama.Ninja.WebSockets.WebSocketClientFactory.


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