B4J Question Server handler class (websocket handler class) instance.

LucaMs

Expert
Licensed User
Longtime User
When a client connects to my server (B4J - jServer) an instance of a "server handler class" is automatically created (it "receives" a websocket object too).

In some cases I want to disconnect the client:

B4X:
    ' Asks client for its "configuration".
    RunClientRoutine("rtnFromServerSendMeConfig", Null)
' HERE I DON'T WANT TO WAIT INDEFINITELY...
    ' Client sent its "configuration".
    Wait For FromClient_ClientConfig(Params As Map)

' the same when I will wait for user's credentials.

After ' HERE I DON'T WANT TO WAIT INDEFINITELY...
I'm thinking to add a "timeout" (https://www.b4x.com/android/forum/threads/b4x-waitforwithtimeout-timeouthandler.110703/ - I "changed" it to a b4xlib, now).
But... what to do when time runs out?
I can only close the websocket and "exit", which means that I will not add the instance to a global Map.
The instance will be automatically killed sooner or later, right?



P.S. I have to change that b4xlib, B4XTimeoutHandler because it can use a label (B4XView), B4J websocket server not.
 
Last edited:
Top