• console.inkey() timeout on slow connections

    From Nightfox@VERT/DIGDIST to All on Sunday, September 27, 2009 13:31:05
    Hi all -

    I have a login matrix script that I've written in JavaScript, where I use console.inkey() to get a keypress from the user with an input timeout. I'm using a timeout of 60000ms (so, it should time out after 60 seconds). It works fine with a fast internet connection, but I've noticed that if I log into my BBS from a computer with a fairly slow connection (i.e., satellite internet connection with a fairly slow upload rate), it times out immediately. Is there a workaround for this?

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS: digdist.bbsindex.com
  • From esc@VERT/MONTEREY to Nightfox on Sunday, September 27, 2009 20:02:26
    Re: console.inkey() timeout on slow connections
    By: Nightfox to All on Sun Sep 27 2009 01:31 pm

    I have a login matrix script that I've written in JavaScript, where I use console.inkey() to get a keypress from the user with an input timeout. I'm using a timeout of 60000ms (so, it should time out after 60 seconds). It wo fine with a fast internet connection, but I've noticed that if I log into my BBS from a computer with a fairly slow connection (i.e., satellite internet connection with a fairly slow upload rate), it times out immediately. Is the a workaround for this?

    Here's what I use. Keep in mind this is ripped from ispy/tracker1's code of the phoenix modded s3 shell script.

    var c = console.inkey();
    if (c == "") {
    sleep(100);
    }else{
    Determine key pressed, etc etc etc.

    Hope that helped man.

    esc(montereybbs/demonic/mimic)

    ---
    þ Synchronet þ :: montereybbs.com ::
  • From Deuce@VERT/SYNCNIX to Nightfox on Monday, September 28, 2009 12:21:51
    Re: console.inkey() timeout on slow connections
    By: Nightfox to All on Sun Sep 27 2009 01:31 pm

    I have a login matrix script that I've written in JavaScript, where I use console.inkey() to get a keypress from the user with an input timeout. I'm using a timeout of 60000ms (so, it should time out after 60 seconds). It works fine with a fast internet connection, but I've noticed that if I log into my BBS from a computer with a fairly slow connection (i.e., satellite internet connection with a fairly slow upload rate), it times out immediately. Is there a workaround for this?

    What is the return value? Is it possible that there were simply keys still pending on the socket?

    Please report bugs instead of working around them. :-)

    ---
    Synchronet - Jump on the Web 0.2 bandwagon!

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Deuce@VERT/SYNCNIX to esc on Monday, September 28, 2009 12:22:29
    Re: console.inkey() timeout on slow connections
    By: esc to Nightfox on Sun Sep 27 2009 08:02 pm

    Here's what I use. Keep in mind this is ripped from ispy/tracker1's code
    of the phoenix modded s3 shell script.

    var c = console.inkey();
    if (c == "") {
    sleep(100);
    }else{
    Determine key pressed, etc etc etc.

    This is the wrong way to do it now... using a timeout is correct (and just as likely to work as the other).

    ---
    Synchronet - Jump on the Web 0.2 bandwagon!

    ---
    þ Synchronet þ My Brand-New BBS (All the cool SysOps run STOCK!)
  • From Nightfox@VERT/DIGDIST to Deuce on Monday, September 28, 2009 15:31:05
    Re: console.inkey() timeout on slow connections
    By: Deuce to Nightfox on Mon Sep 28 2009 12:21:51

    What is the return value? Is it possible that there were simply keys sti pending on the socket?

    Please report bugs instead of working around them. :-)

    I do prefer to report bugs rather than working around them. :) I'm not around that computer with the slow connection now, so I'll have to find a way to simulate a slow internet connection with my BBS so I can do some more testing.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion BBS: digdist.bbsindex.com