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.
|
Inteface for class: WebSocketHandler. More...
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< WebSocketEventArg > | WebsocketEvent |
Event handler for events such as messages and errors. More... | |
Inteface for class: WebSocketHandler.
Definition at line 12 of file WebsocketHandler.cs.
Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.SendMessage | ( | WebSocketMessageContainer | message, |
string | clientId | ||
) |
Send a message to a specific client.
message | Message container containing everything related to the message. |
clientId | Id of the client to send the message to. |
Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.
Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.SendMessage | ( | WebSocketMessageContainer | message | ) |
Sends a message to all connected clients.
message | Message container containing everything related to the message. |
Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.
void SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.StartConnection | ( | TcpClient | client, |
string | clientId, | ||
string | baseUrl | ||
) |
Starts a connection given the settings set by caller.
client | TcpClient socket handler. |
stream | NetworkStream stream handler. |
clientId | Id of client. |
baseUrl | URL path used by client. |
Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.
Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.StopAll | ( | ) |
Stops all connections.
Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.
Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.StopAll | ( | string | reason | ) |
Stops all connections and provides a reason to the clients.
reason | Reason for disconnect. |
Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.
Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.StopClient | ( | string | clientId | ) |
Stops a connection with a specific client.
clientId | Id of client of which to stop the connection with. |
Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.
Task<bool> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.StopClient | ( | string | clientId, |
string | reason | ||
) |
Stops a client while specifying a reason.
clientId | Id of client of which to stop the connection with. |
reason | Reason to send to client. |
Implemented in SimpleWebSocketServerLibrary.SimpleWebSocketHandler.WebSocketHandler.
EventHandler<WebSocketEventArg> SimpleWebSocketServerLibrary.SimpleWebSocketHandler.IWebSocketHandler.WebsocketEvent |
Event handler for events such as messages and errors.
Definition at line 17 of file WebsocketHandler.cs.