#include <string.h>
#include <common/xroad_string.h>
#include <common/xroad_xml.h>
Go to the source code of this file.
|
typedef struct websocket_s | websocket_t |
|
|
enum | ws_data_type_t { ws_data_type_text = 0
, ws_data_type_binary = 1
} |
|
◆ websocket_create()
create new websocket instance
- Parameters
-
[in] | cfg | - websocket xml configuration |
[in] | address | - optional address may be specified instead of xml |
[in] | cback | - websocket callback |
- Returns
- new websocket instance, NULL - not created
◆ websocket_destroy()
void websocket_destroy |
( |
websocket_t * |
ws | ) |
|
destroy websocket instance
- Parameters
-
[in] | ws | - websocket to destory |
◆ websocket_send()
xroad_errno_t websocket_send |
( |
websocket_t * |
ws, |
|
|
void * |
data, |
|
|
size_t |
len, |
|
|
ws_data_type_t |
ws_wp |
|
) |
| |
send data to sebsocket
- Parameters
-
| [im] | ws - websocket instance |
[in] | data | - pointer to sent data |
[in] | len | - length of sent data |
- Returns
- XROAD_OK - successed, else not sent
◆ websocket_start()
xroad_errno_t websocket_start |
( |
websocket_t * |
ws | ) |
|
open websocket
- Parameters
-
[in] | ws | - websocket to open |
- Returns
- XROAD_OK - successed, else failed
◆ websocket_stop()
xroad_errno_t websocket_stop |
( |
websocket_t * |
ws | ) |
|
close websocket
- Parameters
-
[in] | ws | - websocket to close |
- Returns
- XROAD_OK - schedule close operation, else - wrong state