Data Structures | Typedefs | Functions
nm_stream_server.h File Reference

Connection based network message server. More...

Data Structures

struct  vtm_nm_stream_srv_cbs
struct  vtm_nm_stream_srv_opts


typedef struct vtm_nm_stream_srv vtm_nm_stream_srv


VTM_API vtm_nm_stream_srv * vtm_nm_stream_srv_new (void)
VTM_API void vtm_nm_stream_srv_free (vtm_nm_stream_srv *srv)
VTM_API int vtm_nm_stream_srv_run (vtm_nm_stream_srv *srv, struct vtm_nm_stream_srv_opts *opts)
VTM_API int vtm_nm_stream_srv_stop (vtm_nm_stream_srv *srv)

Function Documentation

VTM_API vtm_nm_stream_srv* vtm_nm_stream_srv_new ( void  )

Creates a new server.

the created server which can be used in the other functions
NULL if an error occured
VTM_API void vtm_nm_stream_srv_free ( vtm_nm_stream_srv *  srv)

Frees the server and all allocated resources.

srvthe server which should be freed
VTM_API int vtm_nm_stream_srv_run ( vtm_nm_stream_srv *  srv,
struct vtm_nm_stream_srv_opts opts 

Runs the server.

This method blocks until the server is stopped or if an error occurs.

srvthe previously created server
optsthe options for running the server
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_stream_srv_stop ( vtm_nm_stream_srv *  srv)

Stops the server.

This method blocks until the server is gracefully shutdown.

srvthe server which should be stopped
VTM_OK if the shutdown was successful
VTM_ERROR if an error occured