2016-05-12 04:36:12 +08:00
|
|
|
---
|
|
|
|
title: "mg_send_websocket_frame()"
|
|
|
|
decl_name: "mg_send_websocket_frame"
|
|
|
|
symbol_kind: "func"
|
|
|
|
signature: |
|
|
|
|
void mg_send_websocket_frame(struct mg_connection *nc, int op_and_flags,
|
|
|
|
const void *data, size_t data_len);
|
|
|
|
---
|
|
|
|
|
2016-07-26 22:53:33 +08:00
|
|
|
Send WebSocket frame to the remote end.
|
2016-05-12 04:36:12 +08:00
|
|
|
|
2016-07-26 22:53:33 +08:00
|
|
|
`op_and_flags` specifies the frame's type. It's one of:
|
2016-05-12 04:36:12 +08:00
|
|
|
|
|
|
|
- WEBSOCKET_OP_CONTINUE
|
|
|
|
- WEBSOCKET_OP_TEXT
|
|
|
|
- WEBSOCKET_OP_BINARY
|
|
|
|
- WEBSOCKET_OP_CLOSE
|
|
|
|
- WEBSOCKET_OP_PING
|
|
|
|
- WEBSOCKET_OP_PONG
|
|
|
|
|
|
|
|
Orred with one of the flags:
|
|
|
|
|
|
|
|
- WEBSOCKET_DONT_FIN: Don't set the FIN flag on the frame to be sent.
|
|
|
|
|
|
|
|
`data` and `data_len` contain frame data.
|
|
|
|
|