Web2.0 Reconnections

Yes. But the way Apple’s console works these days the log files are nearly impossible to find.

if you begin your log with "[JON] " and you filter to that you’ll find all your own lines…

3 Likes

Use a shell object and have it write to the file with echo:

sh.Execute("echo """ + msg + """ >> " + f.shellpath)

Where sh is the shell, msg is the message and f is the log file.

4 Likes

If it will occur in Session.Opening, does it mean that the previous Session (and its contents) are gone? Not a real reconnection, but a new connection?

At the point that the JavaScript performs its function, the connection to the server has been gone for at least 10 seconds. It’s likely that it’s a new session, as well. I don’t know everything there is to know about Web 2.0’s session management, so I can’t provide anything more than that.

It’s safe to say that, if the reason it’s reconnecting is because the app has been restarted – as was said in the OP – then yes, it’s a new session.

When I set a SessionTimeout for 20 minutes in other systems, when some client with a SessionId tries to reconnect after 19 minutes, it gets it. Why 10 secs is a problem here?

I missed this point.

All this does is check for connection interruption and reload the page. Like I said, I don’t know all there is to know about the system. If it works, great. I’ve not tested for that. This is just a solution for the problem the OP needed that I happened to have around. Please feel free to test it and report back.

I would assume, since the sessions are cookie-based, that it would resume the session if possible.

I’m in search of technical answers from people that supposed uses correctly and deeper the system, and they know things that I, a Xojo Web newbie wannabe, want to know, comparing with previous knowledge from other systems. I have in mind that I supposedly simply don’t know the "how to"s. But your previous sentence was kind of weird for such context.

My last sentence means that I have no test rig setup for checking this, and I’m trying to encourage you to get involved and help with the testing of something you are seemingly interested in. This will help you gain a greater knowledge of how this functions, and help the rest of us when we decide if we want to use this code in production environments as well.

It seems to be operating fine now. It’s what we may need to use until Xojo adds the automatic reconnect functionality. It does appear a new session is created once the connection error is displayed and a reconnection occurs.

1 Like

Thanks for reporting back!

I’m in the middle of traveling today so I haven’t been able to deploy the updated code with Greg’s recommended session context. That’s where I was seeing sessions that did not have my webpage in them but only the disconnect message.

I’ve been testing this since yesterday. Working fine for what I need :slight_smile:

2 Likes

Excellent. Thanks for sharing your experience.

1 Like

Works great for my project! Thank you Anthony :slight_smile:

1 Like

Thank you Anthony.

1 Like

Its perfect Anthony! Thank you!

1 Like

Hi all, first of all thanks to Anthony. This code works but I still have a bug at my end.

At the moment, I have an iPad connected to a Windows PC on a LAN. My iPad works well as a controller.

If I turn off my PC or close the server app, the iPad does not realise and my UI becomes unresponsive.
If I restart the server, Anthony’s code then restarts the app really well. It just doesn’t fire unless we cycle the server.

My question is, surely there is a client side way of detecting that the server is dead and alerting the user? I just want to let them know so they don’t keep pushing buttons that don’t do anything and get frustrated.