Datagram based network message server.
More...
|
typedef struct vtm_nm_dgram_srv | vtm_nm_dgram_srv |
|
VTM_API vtm_nm_dgram_srv* vtm_nm_dgram_srv_new |
( |
void |
| ) |
|
Creates a new server.
- Returns
- the created server which can be used in the other functions
-
NULL if an error occured
VTM_API void vtm_nm_dgram_srv_free |
( |
vtm_nm_dgram_srv * |
srv | ) |
|
Frees the server and all allocated resources.
- Parameters
-
srv | the server which should be freed |
Runs the server.
This method blocks until the server is stopped or if an error occurs.
- Parameters
-
srv | the previously created server |
opts | the options for running the server |
- Returns
- VTM_OK if the server has been started successfully and has already been shut down again
-
VTM_ERROR or other more specific error code when the server could not be started
VTM_API int vtm_nm_dgram_srv_stop |
( |
vtm_nm_dgram_srv * |
srv | ) |
|
Stops the server.
This method blocks until the server is gracefully shutdown.
- Parameters
-
srv | the server which should be stopped |
- Returns
- VTM_OK if the shutdown was successful
-
VTM_ERROR if an error occured
Sends a message to the given address.
- Parameters
-
srv | the server which sends the message |
msg | the message to send |
saddr | the destination address |
- Returns
- VTM_OK if the datagram was sent successfully
-
VTM_E_IO_UNKNOWN or VTM_ERROR if an error occured