You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, as already explained in #21503 im currently trying to work with -sMEMORY64. The previous bug is resolved, thank you for that. However, now if I receive a message I have the weird bug, that there is no data even though the debug message prints the data.
I have the following code to test:
w:0,t:0x001782f0: websocket event "open": socketId=1,userData=1720968,callbackFunc=2620)
w:0,t:0x001782f0: emscripten_websocket_send_utf8_text(socketId=1,textData=42 ' chars, "{"conten...")
w:0,t:0x001782f0: WebSocket onmessage, received data: "{"type":"login","success":true}", 31 chars, 32 bytes encoded as UTF-8: "{"type":"login","success":true}"
Received message
e is not null 0 0 1
Uncaught RuntimeError: index out of bounds
I get that the index is out of bounds, because there is no data - however the debug message prints the received message correctly? Thanks for your help!
Is it possible, that the fix does not work anymore? I had a look in the library_websocket.js file and saw that some changes were made. If I remove does added lines before getSocketEvent, it works for me again.
Like this:
var LibraryWebSocket = {
$WS: {
sockets: [null],
socketEvent: null,
getSocketEvent(socketId) {
// Singleton event pointer. Use EmscriptenWebSocketCloseEvent, which is
// the largest event struct
this.socketEvent ||= _malloc({{{ C_STRUCTS.EmscriptenWebSocketCloseEvent.__size__ }}});
{{{ makeSetValue('this.socketEvent', 0, 'socketId', 'u32') }}};
return this.socketEvent;
},
},
emscripten_websocket_get_ready_state__deps: ['$WS'],
Are you referring to the changed made in #21531? Did you remove the new getSocket helper along with all the callers of that function?
Yes, at least that's what I thought. I only removed the getSocket call in the first place. However, i tried to revert my changes and installed/activated the latest Emscripten version (3.1.61) again and somehow the error changed and I can't submit you any details. Please just ignore it - thanks for your help.
Activity
[wasm64] Fix library_websocket.js
[wasm64] Fix library_websocket.js (#21527)
tbuchs commentedon Jun 22, 2024
Is it possible, that the fix does not work anymore? I had a look in the
library_websocket.jsfile and saw that some changes were made. If I remove does added lines beforegetSocketEvent, it works for me again.Like this:
sbc100 commentedon Jun 22, 2024
What error are you seeing now?
Are you referring to the changed made in #21531? Did you remove the new
getSockethelper along with all the callers of that function?sbc100 commentedon Jun 22, 2024
Maybe open a new bug? Unless you think the new issue is is the same thing (i.e. wasm64 related).
tbuchs commentedon Jun 23, 2024
Yes, at least that's what I thought. I only removed the
getSocketcall in the first place. However, i tried to revert my changes and installed/activated the latest Emscripten version (3.1.61) again and somehow the error changed and I can't submit you any details. Please just ignore it - thanks for your help.