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
I observe that applyWSSListeners is being called, as I can see 'applying listener' being logged in the console when my page is refreshed and the Socket provider makes a request to the route.ts endpoint (as expected).
However, I never see the 'connection!' string logged to the console. I would understand if this perhaps happened on the first connection as 'applyWSSListeners' is perhaps called after the socket connected - however I cannot understand why I still do not see the message logged in any subsequent connections (after applyWSSListeners has definitely been called).
I am sure the sockets are connecting as when I log server I can see the WebSocket objects in a Set.
I am trying to establish some listeners on my server using the
WebSocketServer
that is exposed within theSOCKET
route.Given the following simple code in a
route.ts
file:I observe that
applyWSSListeners
is being called, as I can see 'applying listener' being logged in the console when my page is refreshed and the Socket provider makes a request to theroute.ts
endpoint (as expected).However, I never see the 'connection!' string logged to the console. I would understand if this perhaps happened on the first connection as 'applyWSSListeners' is perhaps called after the socket connected - however I cannot understand why I still do not see the message logged in any subsequent connections (after applyWSSListeners has definitely been called).
I am sure the sockets are connecting as when I log
server
I can see theWebSocket
objects in a Set.I created this simple example by following the simple example provided by the ws docs .
Could anyone please share how they've handled setting up listeners on the WebSocketServer object?
The text was updated successfully, but these errors were encountered: