Timing out without alarm function

Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default Timing out without alarm function


    Hi all!

    I am new to the list, and have a question which I hope isn't too
    difficult to answer.

    I have a script where I am sending some data over a socket, but after X
    seconds I want the operation to time out. I am currently using alarm to
    enforce the timeout, but I don't want the script to die. I want a way
    to be able to gracefully move onto a different part of the script or
    return some value.

    I am using a timeout value when creating the socket, but this timeout is
    not enforced once the socket connection has been established and
    back-and-forth communication is occurring. I am trying to allot for a
    hang in the middle of the connection.

    Thank you in advance for any suggestions!

    --Sam
    Sam Masiello Guest

  2. Similar Questions and Discussions

    1. Zone Alarm blocks flash????
      Bear with me, I'm not up on computer terms but here goes...I have Zone Alarm security suite and the latest version (I think) of IE. Had some...
    2. HDR Replication and event alarm log backup
      Hi Folks, I got replication up and running finally. The process was as described in the manuals and everything looks good for now. The on bar alarm...
    3. usleep and alarm clock
      Hi, I recently changed some code, from sleep() to usleep(), and now my program is suddenly terminating with an error string of "Alarm clock" being...
    4. Alarm program on IDS9.30UC1
      abdoell wrote: What do IBM Informix tech support say? Cheers, -- Mark. ...
    5. Zone Alarm
      Are there any known compatability issues with WindowsXP and Zone Alarm Pro firwall software? Thank you.
  3. #2

    Default Re: Timing out without alarm function

    --As off Tuesday, February 3, 2004 10:09 AM -0700, Sam Masiello is
    alleged to have said:
    > I have a script where I am sending some data over a socket, but
    > after X seconds I want the operation to time out. I am currently
    > using alarm to enforce the timeout, but I don't want the script to
    > die. I want a way to be able to gracefully move onto a different
    > part of the script or return some value.
    --As for the rest, it is mine.

    What you need to do is catch the signal: perldoc perlipc

    Daniel T. Staal

    ---------------------------------------------------------------
    This email copyright the author. Unless otherwise noted, you
    are expressly allowed to retransmit, quote, or otherwise use
    the contents for non-commercial purposes. This copyright will
    expire 5 years after the author's death, or in 30 years,
    whichever is longer, unless such a period is in excess of
    local copyright law.
    ---------------------------------------------------------------
    Daniel Staal Guest

  4. #3

    Default RE: Timing out without alarm function


    Thank you very much, Daniel!

    --Sam



    Daniel Staal wrote:
    > --As off Tuesday, February 3, 2004 10:09 AM -0700, Sam Masiello is
    > alleged to have said:
    >
    >> I have a script where I am sending some data over a socket, but after
    >> X seconds I want the operation to time out. I am currently using
    >> alarm to enforce the timeout, but I don't want the script to die. I
    >> want a way to be able to gracefully move onto a different part of the
    >> script or return some value.
    >
    > --As for the rest, it is mine.
    >
    > What you need to do is catch the signal: perldoc perlipc
    >
    > Daniel T. Staal
    >
    > ---------------------------------------------------------------
    > This email copyright the author. Unless otherwise noted, you are
    > expressly allowed to retransmit, quote, or otherwise use the contents
    > for non-commercial purposes. This copyright will expire 5 years
    > after the author's death, or in 30 years, whichever is longer, unless
    > such a period is in excess of local copyright law.
    > ---------------------------------------------------------------
    Sam Masiello Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139