Defines the interface for network socket operations. More...
Public Member Functions | |
NetAddress | Bind (NetSocket socket, NetConfig config) |
Binds the socket to the specified address and configuration. More... | |
bool | CanFragment (NetAddress address) |
Determines whether the specified address can be fragmented. More... | |
NetSocket | Create (NetConfig config) |
Creates a new socket with the specified configuration. More... | |
void | DeleteEncryptionKey (NetAddress address) |
Deletes the encryption key for the specified address. More... | |
void | Destroy (NetSocket socket) |
Destroys the specified socket. More... | |
void | Initialize (NetConfig config) |
Initializes the socket with the specified configuration. More... | |
bool | Poll (NetSocket socket, long timeout) |
Polls the socket for incoming data with the specified timeout. More... | |
int | Receive (NetSocket socket, NetAddress *address, byte *buffer, int bufferLength) |
Receives data from the socket into the specified buffer. More... | |
int | Send (NetSocket socket, NetAddress *address, byte *buffer, int bufferLength, bool reliable=false) |
Sends data from the specified buffer to the socket. More... | |
void | SetupEncryption (byte[] key, byte[] encryptedKey) |
Sets up encryption with the specified key and encrypted key. More... | |
Properties | |
bool | SupportsMultiThreading [get] |
Gets a value indicating whether the socket supports multi-threading. More... | |
Defines the interface for network socket operations.
NetAddress Bind | ( | NetSocket | socket, |
NetConfig | config | ||
) |
Binds the socket to the specified address and configuration.
socket | The socket to bind. |
config | The configuration for the socket. |
bool CanFragment | ( | NetAddress | address | ) |
Determines whether the specified address can be fragmented.
address | The address to check. |
Creates a new socket with the specified configuration.
config | The configuration for the socket. |
void DeleteEncryptionKey | ( | NetAddress | address | ) |
Deletes the encryption key for the specified address.
address | The address to delete the encryption key for. |
void Destroy | ( | NetSocket | socket | ) |
Destroys the specified socket.
socket | The socket to destroy. |
void Initialize | ( | NetConfig | config | ) |
Initializes the socket with the specified configuration.
config | The configuration for the socket. |
bool Poll | ( | NetSocket | socket, |
long | timeout | ||
) |
Polls the socket for incoming data with the specified timeout.
socket | The socket to poll. |
timeout | The timeout in milliseconds. |
int Receive | ( | NetSocket | socket, |
NetAddress * | address, | ||
byte * | buffer, | ||
int | bufferLength | ||
) |
Receives data from the socket into the specified buffer.
socket | The socket to receive data from. |
address | The address of the sender. |
buffer | The buffer to store the received data. |
bufferLength | The length of the buffer. |
int Send | ( | NetSocket | socket, |
NetAddress * | address, | ||
byte * | buffer, | ||
int | bufferLength, | ||
bool | reliable = false |
||
) |
Sends data from the specified buffer to the socket.
socket | The socket to send data to. |
address | The address of the recipient. |
buffer | The buffer containing the data to send. |
bufferLength | The length of the buffer. |
reliable | Send reliable or not |
void SetupEncryption | ( | byte[] | key, |
byte[] | encryptedKey | ||
) |
Sets up encryption with the specified key and encrypted key.
key | The encryption key. |
encryptedKey | The encrypted key. |
|
get |
Gets a value indicating whether the socket supports multi-threading.