B4J Question WebSocket_Connected is not reached

B4JExplorer

Active Member
Licensed User
Longtime User
Hi,

The server and AddWebSocket parameters seem to be correct. After having problems, I've simplified an example, to mirror some of the sample we've been given.

So, for example in the AppStart code, we have


srvr.Initialize("srvr")
srvr.AddWebSocket("/ws", "cls_sws_what")


, and inside the cls_sws_what class, we have


Public Sub Initialize

End Sub

Private Sub WebSocket_Connected (WebSocket1 As WebSocket)


Log( "Getting ready to assign the websocket object" )

ws = WebSocket1

Log( "Web Socket connection completed" )

End Sub

Private Sub WebSocket_Disconnected

End Sub


, with a breakpoint, on the first log.

But it never reaches the WebSocket_Connected routine. The basic web page itself shows up, with the html defined in the index.html.

But the code itself, in the cls_sws_what class never gets any attention.

I'd done direct copying & pasting, so I don't think it could be an uppercase/lowercase issue.


Any tips, on where I can look, first?
 

B4JExplorer

Active Member
Licensed User
Longtime User
Looks like we're ok.

After starting from scratch, then adding everything back in from the original project, WebSocket_Connected is being accessed now.

All set, thanks.
 
Upvote 0
Top