1 2 Previous Next 21 Replies Latest reply: Jun 8, 2011 2:22 AM by 853968 Go to original post RSS
      • 15. Re: Signed Applet and page reloading
        baftos
        The applet life-cycle specification is vague, perhaps intentionally. In the past, different browsers had quite different behaviors. I think the consensus those days is that what you see is the most logical behavior.
        Otherwise the question arrises: for how long should we keep the applet alive. And how many such invisible and perhaps useless applets that tie system resources, perhaps with bad intentions?

        Edited by: baftos on Jun 7, 2011 11:23 AM
        • 16. Re: Signed Applet and page reloading
          853968
          @ Mr. Thompson: Damn. I believed this functions will help me.... I don't know how doing otherwise.
          @baftos: applets are the only way of interacting between computer serial ports and javascript imo
          • 17. Re: Signed Applet and page reloading
            baftos
            Sorry, I got it wrong. The applet is the one communicating with serial ports for the benefit of javascript, not vice-versa.
            • 18. Re: Signed Applet and page reloading
              853968
              Right, if you have any other solution... you're welcome lol
              • 19. Re: Signed Applet and page reloading
                sabre150
                flo360 wrote:
                Right, if you have any other solution... you're welcome lol
                Consider not using Javascript.
                • 20. Re: Signed Applet and page reloading
                  baftos
                  Here is what I would suggest. Have two signed applets in your page.

                  Applet 1:
                  - Free floating (or JWS application)
                  - Single instance
                  - Reads the serial port
                  - Listens on a TCP port like 12345
                  - The point is that once launched, browser navigations won't affect it.
                  - Data read from the serial port is written to the TCP connection, if any.

                  Applet 2:
                  - Traditional, stays in the page
                  - On init() or start(), opens a TCP connection to port 12345.
                  - Over the TCP connection, it reads the serial port data.

                  Javacript will talk to Applet 2.

                  Of course, there are some questions to answer before embarking:
                  What Applet 1 does with the data if Applet 2 disconnects (user moves away from the page or closes the browser)? Discards it? Buffers it? How much, for how long?
                  When should Applet 1 exit?

                  Edited by: baftos on Jun 7, 2011 12:04 PM
                  • 21. Re: Signed Applet and page reloading
                    853968
                    Interesting, i'm going to test this. Will tell you if it works fine !
                    1 2 Previous Next