SimpleWebSocketServer Library  v1.0.1
A simple to use websocket with a very easy way to get it to work, just requires four lines of code.
SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler Interface Reference

Inteface for class: WebSocketHandler. More...

+ Inheritance diagram for SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler:

Public Member Functions

Task< bool > SendMessage (WebSocketMessageContainer message, string clientId)
 Send a message to a specific client. More...
 
Task< bool > SendMessage (WebSocketMessageContainer message)
 Sends a message to all connected clients. More...
 
void StartConnection (TcpClient client, string clientId, string baseUrl)
 Starts a connection given the settings set by caller. More...
 
Task< bool > StopClient (string clientId)
 Stops a connection with a specific client. More...
 
Task< bool > StopClient (string clientId, string reason)
 Stops a client while specifying a reason. More...
 
Task< bool > StopAll ()
 Stops all connections. More...
 
Task< bool > StopAll (string reason)
 Stops all connections and provides a reason to the clients. More...
 

Events

EventHandler< WebSocketEventArgWebsocketEvent
 Event handler for events such as messages and errors. More...
 

Detailed Description

Inteface for class: WebSocketHandler.

Definition at line 12 of file WebsocketHandler.cs.

Member Function Documentation

◆ SendMessage() [1/2]

Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.SendMessage ( WebSocketMessageContainer  message,
string  clientId 
)

Send a message to a specific client.

Parameters
messageMessage container containing everything related to the message.
clientIdId of the client to send the message to.
Returns
True on success.

Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.

+ Here is the caller graph for this function:

◆ SendMessage() [2/2]

Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.SendMessage ( WebSocketMessageContainer  message)

Sends a message to all connected clients.

Parameters
messageMessage container containing everything related to the message.
Returns
True on success.

Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.

◆ StartConnection()

void SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.StartConnection ( TcpClient  client,
string  clientId,
string  baseUrl 
)

Starts a connection given the settings set by caller.

Parameters
clientTcpClient socket handler.
streamNetworkStream stream handler.
clientIdId of client.
baseUrlURL path used by client.

Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.

◆ StopAll() [1/2]

Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.StopAll ( )

Stops all connections.

Returns
True on success.

Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.

+ Here is the caller graph for this function:

◆ StopAll() [2/2]

Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.StopAll ( string  reason)

Stops all connections and provides a reason to the clients.

Parameters
reasonReason for disconnect.
Returns
True on success.

Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.

◆ StopClient() [1/2]

Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.StopClient ( string  clientId)

Stops a connection with a specific client.

Parameters
clientIdId of client of which to stop the connection with.
Returns
True on success.

Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.

+ Here is the caller graph for this function:

◆ StopClient() [2/2]

Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.StopClient ( string  clientId,
string  reason 
)

Stops a client while specifying a reason.

Parameters
clientIdId of client of which to stop the connection with.
reasonReason to send to client.
Returns
True on success.

Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.

Event Documentation

◆ WebsocketEvent

EventHandler<WebSocketEventArg> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.WebsocketEvent

Event handler for events such as messages and errors.

Definition at line 17 of file WebsocketHandler.cs.


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