Datagram socket object.
More...
|
| CMSocketResult(* | Bind )(CMUTIL_DGramSocket *dsock, const CMUTIL_SocketAddr *saddr) |
| | Bind the datagram socket to a specific address.
|
| |
| CMSocketResult(* | Connect )(CMUTIL_DGramSocket *dsock, const CMUTIL_SocketAddr *saddr) |
| | Connect the datagram socket to a specific address.
|
| |
| CMBool(* | IsConnected )(CMUTIL_DGramSocket *dsock) |
| | Check if the datagram socket is connected.
|
| |
| void(* | Disconnect )(CMUTIL_DGramSocket *dsock) |
| | Disconnect the datagram socket.
|
| |
| CMSocketResult(* | GetRemoteAddr )(CMUTIL_DGramSocket *dsock, CMUTIL_SocketAddr *saddr) |
| | Get the remote address of the datagram socket.
|
| |
| CMSocketResult(* | GetLocalAddr )(CMUTIL_DGramSocket *dsock, CMUTIL_SocketAddr *saddr) |
| | Get the local address of the datagram socket.
|
| |
| CMSocketResult(* | Send )(CMUTIL_DGramSocket *dsock, CMUTIL_ByteBuffer *buf, long timeout) |
| | Send data to the connected remote address.
|
| |
| CMSocketResult(* | Recv )(CMUTIL_DGramSocket *dsock, CMUTIL_ByteBuffer *buf, long timeout) |
| | Receive data from the connected remote address.
|
| |
| CMSocketResult(* | SendTo )(CMUTIL_DGramSocket *dsock, CMUTIL_ByteBuffer *buf, CMUTIL_SocketAddr *saddr, long timeout) |
| | Send data to a specific address.
|
| |
| CMSocketResult(* | RecvFrom )(CMUTIL_DGramSocket *dsock, CMUTIL_ByteBuffer *buf, CMUTIL_SocketAddr *saddr, long timeout) |
| | Receive data from a specific address.
|
| |
| void(* | Close )(CMUTIL_DGramSocket *dsock) |
| | Close the datagram socket.
|
| |
◆ Bind
Bind the datagram socket to a specific address.
- Parameters
-
| dsock | The datagram socket object to bind. |
| saddr | The socket address to bind to. |
- Returns
- CMSocketResult indicating success or failure.
◆ Connect
Connect the datagram socket to a specific address.
- Parameters
-
| dsock | The datagram socket object to connect. |
| saddr | The socket address to connect to. |
- Returns
- CMSocketResult indicating success or failure.
◆ IsConnected
Check if the datagram socket is connected.
- Parameters
-
| dsock | The datagram socket object to check. |
- Returns
- CMTrue if the socket is connected, CMFalse otherwise.
◆ Disconnect
Disconnect the datagram socket.
- Parameters
-
| dsock | The datagram socket object to disconnect. |
◆ GetRemoteAddr
Get the remote address of the datagram socket.
- Parameters
-
| dsock | The datagram socket object. |
| saddr | Pointer to the socket address object to store the remote address. |
- Returns
- CMSocketResult indicating success or failure.
◆ GetLocalAddr
Get the local address of the datagram socket.
- Parameters
-
| dsock | The datagram socket object. |
| saddr | Pointer to the socket address object to store the local address. |
- Returns
- CMSocketResult indicating success or failure.
◆ Send
Send data to the connected remote address.
To use this function, the datagram socket must be connected first.
- Parameters
-
| dsock | The datagram socket object. |
| buf | The byte buffer containing the data to send. |
| timeout | The send operation timeout in milliseconds. |
- Returns
- CMSocketResult indicating success or failure.
◆ Recv
Receive data from the connected remote address.
To use this function, the datagram socket must be connected first.
- Parameters
-
| dsock | The datagram socket object. |
| buf | The byte buffer to store the received data. |
| timeout | The receive operation timeout in milliseconds. |
- Returns
- CMSocketResult indicating success or failure.
◆ SendTo
Send data to a specific address.
- Parameters
-
| dsock | The datagram socket object. |
| buf | The byte buffer containing the data to send. |
| saddr | The socket address to send the data to. |
| timeout | The send operation timeout in milliseconds. |
- Returns
- CMSocketResult indicating success or failure.
◆ RecvFrom
Receive data from a specific address.
- Parameters
-
| dsock | The datagram socket object. |
| buf | The byte buffer to store the received data. |
| saddr | Pointer to the socket address object to store the sender's address. |
| timeout | The receive operation timeout in milliseconds. |
- Returns
- CMSocketResult indicating success or failure.
◆ Close
Close the datagram socket.
This function closes the datagram socket and releases any associated resources.
- Parameters
-
| dsock | The datagram socket object to be closed. |
The documentation for this struct was generated from the following file: