WebSocket server-side connection.
More...
|
typedef struct vtm_ws_con | vtm_ws_con |
|
VTM_API int vtm_ws_con_send_msg |
( |
vtm_ws_con * |
con, |
|
|
enum vtm_ws_msg_type |
type, |
|
|
const void * |
data, |
|
|
size_t |
len |
|
) |
| |
Sends a message to the peer.
- Parameters
-
con | the connection where the message should be sent over |
type | the type of the WebSocket message |
data | pointer to message payload |
len | length of payload in bytes |
- Returns
- VTM_OK if the transmission was successfully started
-
VTM_E_IO_UNKNOWN or VTM_ERROR if an error occcured
VTM_API int vtm_ws_con_get_remote_info |
( |
vtm_ws_con * |
con, |
|
|
char * |
buf, |
|
|
size_t |
len, |
|
|
unsigned int * |
port |
|
) |
| |
Retrieves the source ip address and used port of a client connection.
- Parameters
-
| con | the connection whose remote address should be retrieved |
[out] | buf | the buffer where the ip address string representation is stored |
| len | the length of the buffer in bytes |
[out] | port | the used port number |
- Returns
- VTM_OK if the address was successfully retrieved
-
VTM_E_IO_UNKNOWN or VTM_ERROR if an error occcured