Typedefs | Functions
nm_stream_connection.h File Reference

Client connection of network message server. More...

Typedefs

typedef struct vtm_nm_stream_con vtm_nm_stream_con
 

Functions

VTM_API void vtm_nm_stream_con_set_usr_data (vtm_nm_stream_con *con, void *data)
 
VTM_API void * vtm_nm_stream_con_get_usr_data (vtm_nm_stream_con *con)
 
VTM_API int vtm_nm_stream_con_send (vtm_nm_stream_con *con, vtm_dataset *msg)
 
VTM_API void vtm_nm_stream_con_close (vtm_nm_stream_con *con)
 

Function Documentation

VTM_API void vtm_nm_stream_con_set_usr_data ( vtm_nm_stream_con *  con,
void *  data 
)

Stores arbitrary user data with the connection.

Parameters
conthe connection that should store the user data
datathe data that should be stored
VTM_API void* vtm_nm_stream_con_get_usr_data ( vtm_nm_stream_con *  con)

Retrieves the stored user data.

Parameters
conthe connection
Returns
the previous saved user data
NULL if no data was stored
VTM_API int vtm_nm_stream_con_send ( vtm_nm_stream_con *  con,
vtm_dataset msg 
)

Sends a message to the client.

Parameters
conthe connection
msgthe message that sould be sent
Returns
VTM_OK if the message was sent successfully
VTM_E_IO_UNKOWN or VTM_ERROR if an error occured
VTM_API void vtm_nm_stream_con_close ( vtm_nm_stream_con *  con)

Closes the client connection gracefully.

Parameters
conthe connection that should be closed