Send websocket text to client from another Function. #1971
-
Excuse this probably dumb Question, Im Hobbyist and learning C bit by bit. Im testet the WS-Server Tutorial and it works. Now i want to send Websocket Text from another function (for example sendText() ). When i do: mg_ws_send(c, "test",5, WEBSOCKET_OP_TEXT); my Compiler claims "Symbol 'c' could not be resolved". So I think I have to give the function access to struct mg_connection *c which is in But how to do this? I know this is not related to mongoose.ws, but maybe someone help me with this, thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Many examples do that |
Beta Was this translation helpful? Give feedback.
Many examples do that
Perhaps the timers example is the simplest: https://mongoose.ws/tutorials/timers/
https://mongoose.ws/tutorials