|
- #include "IZ_websocket.h"
-
- void IZ_WebsocketInitialize(IZ_Websocket* ws) {
- ws->context = NULL;
- ws->interrupted = false;
- }
-
- IZ_ProcedureResult IZ_WebsocketHandle(IZ_Websocket* ws) {
- return lws_service_tsi(ws->context, -1, 0);
- }
-
- void IZ_WebsocketCancelService(IZ_Websocket* ws) {
- ws->interrupted = true;
- lws_cancel_service(ws->context);
- }
-
- void IZ_WebsocketTeardown(IZ_Websocket* ws) {
- lws_context_destroy(ws->context);
- ws->context = NULL;
- }
-
- void IZ_WebsocketDestroyMessage(void* msg_raw) {
- IZ_WebsocketMessage* msg = msg_raw;
- free(msg->payload);
- msg->payload = NULL;
- msg->len = 0;
- }
|