ProtonNet Server 1.0
An Open Solution for all your socket or web api needs.
Loading...
Searching...
No Matches
XmobiTea.ProtonNetServer.IWsServer Interface Reference

Represents the interface for a WebSocket server, providing methods for broadcasting and closing WebSocket connections. More...

Inheritance diagram for XmobiTea.ProtonNetServer.IWsServer:
XmobiTea.ProtonNetServer.IServer XmobiTea.ProtonNetServer.WsServer XmobiTea.ProtonNetServer.WssServer XmobiTea.ProtonNet.Server.Socket.Server.SocketWsServer XmobiTea.ProtonNet.Server.Socket.Server.SocketWssServer

Public Member Functions

bool CloseAll ()
 Closes all WebSocket connections.
 
bool CloseAll (int status)
 Closes all WebSocket connections with the specified status code.
 
bool CloseAll (int status, byte[] buffer)
 Closes all WebSocket connections with the specified status code and a buffer.
 
bool CloseAll (int status, byte[] buffer, int position, int length)
 Closes all WebSocket connections with the specified status code and a buffer with a specified position and length.
 
bool MulticastText (byte[] buffer)
 Broadcasts a text message to all WebSocket connections.
 
bool MulticastText (byte[] buffer, int position, int length)
 Broadcasts a text message to all WebSocket connections with a specified position and length.
 
bool MulticastTextAsync (byte[] buffer)
 Broadcasts a text message asynchronously to all WebSocket connections.
 
bool MulticastTextAsync (byte[] buffer, int position, int length)
 Broadcasts a text message asynchronously to all WebSocket connections with a specified position and length.
 
bool MulticastBinary (byte[] buffer)
 Broadcasts a binary message to all WebSocket connections.
 
bool MulticastBinary (byte[] buffer, int position, int length)
 Broadcasts a binary message to all WebSocket connections with a specified position and length.
 
bool MulticastBinaryAsync (byte[] buffer)
 Broadcasts a binary message asynchronously to all WebSocket connections.
 
bool MulticastBinaryAsync (byte[] buffer, int position, int length)
 Broadcasts a binary message asynchronously to all WebSocket connections with a specified position and length.
 
bool MulticastPing (byte[] buffer)
 Broadcasts a ping message to all WebSocket connections.
 
bool MulticastPing (byte[] buffer, int position, int length)
 Broadcasts a ping message to all WebSocket connections with a specified position and length.
 
bool MulticastPingAsync (byte[] buffer)
 Broadcasts a ping message asynchronously to all WebSocket connections.
 
bool MulticastPingAsync (byte[] buffer, int position, int length)
 Broadcasts a ping message asynchronously to all WebSocket connections with a specified position and length.
 
- Public Member Functions inherited from XmobiTea.ProtonNetServer.IServer
bool Start ()
 Starts the server.
 
bool Stop ()
 Stops the server.
 
bool Restart ()
 Restarts the server.
 
bool BroadcastAll (byte[] buffer)
 Broadcasts a message to all connected clients.
 
bool BroadcastAll (byte[] buffer, int position, int length)
 Broadcasts a message to all connected clients with a specified position and length.
 
bool BroadcastAllAsync (byte[] buffer)
 Broadcasts a message asynchronously to all connected clients.
 
bool BroadcastAllAsync (byte[] buffer, int position, int length)
 Broadcasts a message asynchronously to all connected clients with a specified position and length.
 
bool DisconnectAll ()
 Disconnects all connected clients.
 
IServerNetworkStatistics GetNetworkStatistics ()
 Gets the network statistics for the server.
 

Detailed Description

Represents the interface for a WebSocket server, providing methods for broadcasting and closing WebSocket connections.

Member Function Documentation

◆ CloseAll() [1/4]

bool XmobiTea.ProtonNetServer.IWsServer.CloseAll ( )

Closes all WebSocket connections.

Returns
True if the connections were closed successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ CloseAll() [2/4]

bool XmobiTea.ProtonNetServer.IWsServer.CloseAll ( int status)

Closes all WebSocket connections with the specified status code.

Parameters
statusThe status code to send with the close frame.
Returns
True if the connections were closed successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ CloseAll() [3/4]

bool XmobiTea.ProtonNetServer.IWsServer.CloseAll ( int status,
byte[] buffer )

Closes all WebSocket connections with the specified status code and a buffer.

Parameters
statusThe status code to send with the close frame.
bufferThe buffer containing additional data to send with the close frame.
Returns
True if the connections were closed successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ CloseAll() [4/4]

bool XmobiTea.ProtonNetServer.IWsServer.CloseAll ( int status,
byte[] buffer,
int position,
int length )

Closes all WebSocket connections with the specified status code and a buffer with a specified position and length.

Parameters
statusThe status code to send with the close frame.
bufferThe buffer containing additional data to send with the close frame.
positionThe starting position in the buffer.
lengthThe length of the data to send.
Returns
True if the connections were closed successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastBinary() [1/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastBinary ( byte[] buffer)

Broadcasts a binary message to all WebSocket connections.

Parameters
bufferThe buffer containing the binary message.
Returns
True if the message was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastBinary() [2/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastBinary ( byte[] buffer,
int position,
int length )

Broadcasts a binary message to all WebSocket connections with a specified position and length.

Parameters
bufferThe buffer containing the binary message.
positionThe starting position in the buffer.
lengthThe length of the data to send.
Returns
True if the message was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastBinaryAsync() [1/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastBinaryAsync ( byte[] buffer)

Broadcasts a binary message asynchronously to all WebSocket connections.

Parameters
bufferThe buffer containing the binary message.
Returns
True if the message was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastBinaryAsync() [2/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastBinaryAsync ( byte[] buffer,
int position,
int length )

Broadcasts a binary message asynchronously to all WebSocket connections with a specified position and length.

Parameters
bufferThe buffer containing the binary message.
positionThe starting position in the buffer.
lengthThe length of the data to send.
Returns
True if the message was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastPing() [1/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastPing ( byte[] buffer)

Broadcasts a ping message to all WebSocket connections.

Parameters
bufferThe buffer containing the ping message.
Returns
True if the ping was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastPing() [2/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastPing ( byte[] buffer,
int position,
int length )

Broadcasts a ping message to all WebSocket connections with a specified position and length.

Parameters
bufferThe buffer containing the ping message.
positionThe starting position in the buffer.
lengthThe length of the data to send.
Returns
True if the ping was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastPingAsync() [1/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastPingAsync ( byte[] buffer)

Broadcasts a ping message asynchronously to all WebSocket connections.

Parameters
bufferThe buffer containing the ping message.
Returns
True if the ping was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastPingAsync() [2/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastPingAsync ( byte[] buffer,
int position,
int length )

Broadcasts a ping message asynchronously to all WebSocket connections with a specified position and length.

Parameters
bufferThe buffer containing the ping message.
positionThe starting position in the buffer.
lengthThe length of the data to send.
Returns
True if the ping was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastText() [1/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastText ( byte[] buffer)

Broadcasts a text message to all WebSocket connections.

Parameters
bufferThe buffer containing the text message.
Returns
True if the message was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastText() [2/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastText ( byte[] buffer,
int position,
int length )

Broadcasts a text message to all WebSocket connections with a specified position and length.

Parameters
bufferThe buffer containing the text message.
positionThe starting position in the buffer.
lengthThe length of the data to send.
Returns
True if the message was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastTextAsync() [1/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastTextAsync ( byte[] buffer)

Broadcasts a text message asynchronously to all WebSocket connections.

Parameters
bufferThe buffer containing the text message.
Returns
True if the message was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.

◆ MulticastTextAsync() [2/2]

bool XmobiTea.ProtonNetServer.IWsServer.MulticastTextAsync ( byte[] buffer,
int position,
int length )

Broadcasts a text message asynchronously to all WebSocket connections with a specified position and length.

Parameters
bufferThe buffer containing the text message.
positionThe starting position in the buffer.
lengthThe length of the data to send.
Returns
True if the message was sent successfully; otherwise, false.

Implemented in XmobiTea.ProtonNetServer.WsServer, and XmobiTea.ProtonNetServer.WssServer.


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