Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multipage websocket communication
#5
Thank you, Alexandre. I'm not ignoring you, but trying hard to solve the situation myself. I changed the design from using two IW forms to a single form with a tabbed control on one form to switch between views. Communications still drop out when I change tabs. To summarize the design, it starts with a normal Delphi application that has a grid of rows to select and some start and stop buttons. Using Intraweb and the sgcWebSockets components, I'm trying to build a "remote control" web application to allow a web page to select rows and push the buttons. It all works very well as long as there is only one page/tab on the IW app. When I try to change the screen on the IW app, communication to the main exe is lost. As an example, here is a log of the "conversation" between the two applications. The main exe is WS... and the IW app is Send and In.

00:02:01.777 - WSConnected 2969 ( I start the web page and do a socket1.open, the main exe says it's connected)
00:02:01.794 - Clnt connect (the web page app says it's connected too)
00:02:02.048 - Send load (and sends a request for some data)
00:02:02.052 - WSRcvd: load (the main exe receives the request)
00:02:02.067 - In 3|2|S2|playlist.m3u|4|S4|Bells||| (and sends back the data, delimited by |)
00:02:14.490 - Send goto 2 (the main exe has a grid on it, we ask to click line 2)
00:02:14.495 - WSRcvd: goto 2 (the main exe gets the ask)
00:02:14.503 - In next0 (and sends back a message for the web app to go to the same line)
00:02:25.865 - Send play (the main exe has a list of songs, we selected #2 before and now we play it)
00:02:25.870 - WSRcvd: play (the main exe gets the play request and does it)
00:03:00.463 - Send fade ( we want to fade out that song)
00:03:00.468 - WSRcvd: fade (main exe acknowledges and tells the web app to advance to the next line)
00:03:04.941 - In next1 (web app gets that request)

Now we switch to the second tab on the IW web app page, no indication of a disconnect
00:03:31.783 - Send lback (so the web app sends a message from a button click on the second tab page)

No response the main exe that it's listening, and nothing happens at the main exe
00:04:40.795 - Send goto 2 (so we go back to the first tab and ask again to click line 2, nothing happens, we've lost communication without any sign of loss from either end)

Somehow in my research and trials, I've missed the correct design of an IW app that maintains websocket communication across 2 pages or tabs. I'm also checking with the Experts Exchange folks to see if anyone there has a suggestion.
Reply


Messages In This Thread
RE: Multipage websocket communication - by zsleo - 03-14-2024, 09:30 PM
RE: Multipage websocket communication - by davidbaxter - 04-10-2024, 02:40 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)