What values might get passed to the eventType parameter of my WebSocket callbacks?

17 views
Skip to first unread message

Jeremy Friesner

unread,
Jan 1, 2025, 5:49:58 AMJan 1
to emscripten-discuss
Hi all,

I'm using the Emscripten websocket-callback API (i.e. emscripten_websocket_set_onopen_callback(), emscripten_websocket_set_onmessage_callback(), emscripten_websocket_set_onerror_callback(), and emscripten_websocket_set_onclose_callback()) to do WebSocket I/O, and it's working fine, but I'm a little puzzled about the purpose of the "int eventType" argument that gets passed to my callback-functions.

- What values should I expect to receive in that parameter?  I can't find any likely candidates in the emsdk header files, and the documentation doesn't mention any.

 - Is there some reason why the eventType parameter is passed as a separate argument, instead of being included in the EmscriptenWebSocketXXXEvent struct with the rest of the information describing the event?

Thanks,
Jeremy
Reply all
Reply to author
Forward
0 new messages