|
|
DriveWorks SDK Reference| 0.6.67 Release |
Provides functionality for inter-process communication.
Typedefs | |
| typedef struct dwSocketClientObject * | dwSocketClientHandle_t |
| Handle representing the a network socket client. More... | |
| typedef struct dwSocketConnectionObject * | dwSocketConnectionHandle_t |
| Handle representing the a bi-directional client-server network socket connection. More... | |
| typedef struct dwSocketServerObject * | dwSocketServerHandle_t |
| Handle representing the a network socket server. More... | |
Functions | |
| DW_API_PUBLIC dwStatus | dwSocketClient_broadcast (const uint8_t *buffer, size_t buffer_size, dwSocketClientHandle_t client) |
| Broadcasts a message to all connected sockets of the pool. More... | |
| DW_API_PUBLIC dwStatus | dwSocketClient_connect (dwSocketConnectionHandle_t *connection, const char *server_ip, uint16_t port, dwTime_t timeout_us, dwSocketClientHandle_t client) |
| Connects a socket connection to a listening socket server. More... | |
| DW_API_PUBLIC dwStatus | dwSocketClient_initialize (dwSocketClientHandle_t *client, size_t connection_pool_size, dwContextHandle_t context) |
| Creates and initializes a socket client. More... | |
| DW_API_PUBLIC dwStatus | dwSocketClient_release (dwSocketClientHandle_t *client) |
| Terminate a socket client. More... | |
| DW_API_PUBLIC dwStatus | dwSocketConnection_peek (uint8_t *buffer, size_t *buffer_size, dwSocketConnectionHandle_t connection) |
| Peek at a message of a given length from the network connection (blocking). More... | |
| DW_API_PUBLIC dwStatus | dwSocketConnection_peekNonBlock (uint8_t *buffer, size_t *buffer_size, dwSocketConnectionHandle_t connection) |
| Peek at a message of a given length from the network connection (non-blocking). More... | |
| DW_API_PUBLIC dwStatus | dwSocketConnection_recv (uint8_t *buffer, size_t *buffer_size, dwSocketConnectionHandle_t connection) |
| Receive a message of a given length from the network connection (blocking). More... | |
| DW_API_PUBLIC dwStatus | dwSocketConnection_recvNonBlock (uint8_t *buffer, size_t *buffer_size, dwSocketConnectionHandle_t connection) |
| Receive a message of a given length from the network connection if data is available (non-blocking). More... | |
| DW_API_PUBLIC dwStatus | dwSocketConnection_release (dwSocketConnectionHandle_t *connection) |
| Terminate a socket connection. More... | |
| DW_API_PUBLIC dwStatus | dwSocketConnection_send (const uint8_t *buffer, size_t *buffer_size, dwSocketConnectionHandle_t connection) |
| Send a message of a given length through the socket connection. More... | |
| DW_API_PUBLIC dwStatus | dwSocketServer_accept (dwSocketConnectionHandle_t *connection, dwTime_t timeout_us, dwSocketServerHandle_t server) |
| Accepts an incoming connection at a socket server. More... | |
| DW_API_PUBLIC dwStatus | dwSocketServer_broadcast (const uint8_t *buffer, size_t buffer_size, dwSocketServerHandle_t server) |
| Broadcasts a message to all connected sockets of the pool. More... | |
| DW_API_PUBLIC dwStatus | dwSocketServer_initialize (dwSocketServerHandle_t *server, uint16_t port, size_t connection_pool_size, dwContextHandle_t context) |
| Creates and initializes a socket server accepting incoming client connections. More... | |
| DW_API_PUBLIC dwStatus | dwSocketServer_release (dwSocketServerHandle_t *server) |
| Terminate a socket server. More... | |
| typedef struct dwSocketClientObject* dwSocketClientHandle_t |
Handle representing the a network socket client.
Definition at line 63 of file SocketClientServer.h.
| typedef struct dwSocketConnectionObject* dwSocketConnectionHandle_t |
Handle representing the a bi-directional client-server network socket connection.
Definition at line 66 of file SocketClientServer.h.
| typedef struct dwSocketServerObject* dwSocketServerHandle_t |
Handle representing the a network socket server.
Definition at line 60 of file SocketClientServer.h.
| DW_API_PUBLIC dwStatus dwSocketClient_broadcast | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| dwSocketClientHandle_t | client | ||
| ) |
Broadcasts a message to all connected sockets of the pool.
| [in] | buffer | A pointer to the data to be send. |
| [in] | buffer_size | The number of bytes to send. |
| [in] | client | A handle to the socket client. |
| DW_API_PUBLIC dwStatus dwSocketClient_connect | ( | dwSocketConnectionHandle_t * | connection, |
| const char * | server_ip, | ||
| uint16_t | port, | ||
| dwTime_t | timeout_us, | ||
| dwSocketClientHandle_t | client | ||
| ) |
Connects a socket connection to a listening socket server.
| [out] | connection | A pointer to the socket connection handle will be returned here. |
| [in] | server_ip | A pointer to string representation of the the server's IP address. |
| [in] | port | The network port the server is listening on. |
| [in] | timeout_us | Timeout to block this call. |
| [in] | client | A handle to the socket client. |
| DW_API_PUBLIC dwStatus dwSocketClient_initialize | ( | dwSocketClientHandle_t * | client, |
| size_t | connection_pool_size, | ||
| dwContextHandle_t | context | ||
| ) |
Creates and initializes a socket client.
| [out] | client | A pointer to the client handle will be returned here. |
| [in] | connection_pool_size | The maximal number of concurrently connected connections. |
| [in] | context | Specifies the handle to the context under which the socket client is created. |
| DW_API_PUBLIC dwStatus dwSocketClient_release | ( | dwSocketClientHandle_t * | client | ) |
Terminate a socket client.
| [in] | client | A handle to the socket client. |
| DW_API_PUBLIC dwStatus dwSocketConnection_peek | ( | uint8_t * | buffer, |
| size_t * | buffer_size, | ||
| dwSocketConnectionHandle_t | connection | ||
| ) |
Peek at a message of a given length from the network connection (blocking).
| [in] | buffer | A pointer to the memory location data is written to. |
| [in,out] | buffer_size | A pointer to the number of bytes to receive, and the actual number of bytes received on success. |
| [in] | connection | A handle to the network socket connection. |
| DW_API_PUBLIC dwStatus dwSocketConnection_peekNonBlock | ( | uint8_t * | buffer, |
| size_t * | buffer_size, | ||
| dwSocketConnectionHandle_t | connection | ||
| ) |
Peek at a message of a given length from the network connection (non-blocking).
| [in] | buffer | A pointer to the memory location data is written to. |
| [in,out] | buffer_size | A pointer to the number of bytes to receive, and the actual number of bytes received on success. |
| [in] | connection | A handle to the network socket connection. |
| DW_API_PUBLIC dwStatus dwSocketConnection_recv | ( | uint8_t * | buffer, |
| size_t * | buffer_size, | ||
| dwSocketConnectionHandle_t | connection | ||
| ) |
Receive a message of a given length from the network connection (blocking).
| [in] | buffer | A pointer to the memory location data is written to. |
| [in,out] | buffer_size | A pointer to the number of bytes to receive, and the actual number of bytes received on success. |
| [in] | connection | A handle to the network socket connection. |
| DW_API_PUBLIC dwStatus dwSocketConnection_recvNonBlock | ( | uint8_t * | buffer, |
| size_t * | buffer_size, | ||
| dwSocketConnectionHandle_t | connection | ||
| ) |
Receive a message of a given length from the network connection if data is available (non-blocking).
| [in] | buffer | A pointer to the memory location data is written to. |
| [in,out] | buffer_size | The number of bytes to receive, and actual number of bytes received on success. |
| [in] | connection | A handle to the network socket connection. |
| DW_API_PUBLIC dwStatus dwSocketConnection_release | ( | dwSocketConnectionHandle_t * | connection | ) |
Terminate a socket connection.
| [in] | connection | A handle to the socket connection. |
| DW_API_PUBLIC dwStatus dwSocketConnection_send | ( | const uint8_t * | buffer, |
| size_t * | buffer_size, | ||
| dwSocketConnectionHandle_t | connection | ||
| ) |
Send a message of a given length through the socket connection.
| [in] | buffer | A pointer to the data to be send. |
| [in,out] | buffer_size | A pointer to the number of bytes to send, and the actual number of bytes send on success. |
| [in] | connection | A handle to the network socket connection. |
| DW_API_PUBLIC dwStatus dwSocketServer_accept | ( | dwSocketConnectionHandle_t * | connection, |
| dwTime_t | timeout_us, | ||
| dwSocketServerHandle_t | server | ||
| ) |
Accepts an incoming connection at a socket server.
| [out] | connection | A pointer to the socket connection handle will be returned here. |
| [in] | timeout_us | Timeout to block this call. |
| [in] | server | A handle to the socket server. |
| DW_API_PUBLIC dwStatus dwSocketServer_broadcast | ( | const uint8_t * | buffer, |
| size_t | buffer_size, | ||
| dwSocketServerHandle_t | server | ||
| ) |
Broadcasts a message to all connected sockets of the pool.
| [in] | buffer | A pointer to the data to be send. |
| [in] | buffer_size | The number of bytes to send. |
| [in] | server | A handle to the socket server. |
| DW_API_PUBLIC dwStatus dwSocketServer_initialize | ( | dwSocketServerHandle_t * | server, |
| uint16_t | port, | ||
| size_t | connection_pool_size, | ||
| dwContextHandle_t | context | ||
| ) |
Creates and initializes a socket server accepting incoming client connections.
| [out] | server | A pointer to the server handle will be returned here. |
| [in] | port | The network port the server is listening on. |
| [in] | connection_pool_size | The maximal number of concurrently acceptable connections. |
| [in] | context | Specifies the handle to the context under which the socket server is created. |
| DW_API_PUBLIC dwStatus dwSocketServer_release | ( | dwSocketServerHandle_t * | server | ) |
Terminate a socket server.
| [in] | server | A handle to the socket server. |