<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to implement timeout with sys$qio in tcp ip programming in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/how-to-implement-timeout-with-sys-qio-in-tcp-ip-programming/m-p/4423703#M16665</link>
    <description>Ravikanth,&lt;BR /&gt;&lt;BR /&gt; You're nearly there!&lt;BR /&gt;&lt;BR /&gt;  Your timer AST just needs to $CANCEL(channel). If it fires before the $QIOW completes, it will cancel the I/O. You then cancel the timer and can check the IOSB to see if the I/O completed. SS$_ABORT or SS$_CANCEL indicate it was timed out.&lt;BR /&gt;&lt;BR /&gt;  $setimr(EFN$C_ENF,timout,cancel_io,TIMER_ID)&lt;BR /&gt;$qiow(EFN$C_ENF,channel,IO$_READVBLK,iosb,,,buffer,bufLen)&lt;BR /&gt;$cantim(TIMER_ID)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cancel_io looks like&lt;BR /&gt;  $cancel(channel)</description>
    <pubDate>Wed, 20 May 2009 21:32:14 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2009-05-20T21:32:14Z</dc:date>
    <item>
      <title>how to implement timeout with sys$qio in tcp ip programming</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-implement-timeout-with-sys-qio-in-tcp-ip-programming/m-p/4423701#M16663</link>
      <description>I have to make tcp ip connection to server by sending xml messages as request and have to recieve xml messages as response. I have done coding using Sys$qio system calls to communicate with the server.&lt;BR /&gt;&lt;BR /&gt;When i send correct xml requests, i am gettng xml response properly. But when i am sending incorrect xml requests, the sys$qiow system call is hanging indefinitely for getting response.&lt;BR /&gt;Please find the timer routine and system calls i have used.&lt;BR /&gt;&lt;BR /&gt;void timer_routine()&lt;BR /&gt;{&lt;BR /&gt;printf("timer has fired");&lt;BR /&gt;exit(1);&lt;BR /&gt;}&lt;BR /&gt;status = sys$setimr(0,timeout,timer_routine,TIMER_ID,0);&lt;BR /&gt;&lt;BR /&gt;status = sys$qiow(0, channel, IO$_READVBLK, iosb, 0, 0, buffer, bufLen, 0, 0, 0, 0);&lt;BR /&gt;&lt;BR /&gt;sys$cantim(TIMER_ID,0);&lt;BR /&gt;&lt;BR /&gt;can one help me in solving this?</description>
      <pubDate>Wed, 20 May 2009 17:15:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-implement-timeout-with-sys-qio-in-tcp-ip-programming/m-p/4423701#M16663</guid>
      <dc:creator>RAVIKANTH_3</dc:creator>
      <dc:date>2009-05-20T17:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to implement timeout with sys$qio in tcp ip programming</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-implement-timeout-with-sys-qio-in-tcp-ip-programming/m-p/4423702#M16664</link>
      <description>To implement a timeout you have to use SYS$QIO instead of SYS$QIOW.  CAUTION: do not use event flag #0 with SYS$QIO (best to call LIB$GET_EF).&lt;BR /&gt;&lt;BR /&gt;I have attached a useful routine I wrote years ago, SYNCH_WITH_TIMEOUT.C.  &lt;BR /&gt;&lt;BR /&gt;Use it like this:&lt;BR /&gt;...&lt;BR /&gt;short channel;&lt;BR /&gt;short volatile iosb[4];&lt;BR /&gt;float timeout=10.0;&lt;BR /&gt;...&lt;BR /&gt;status = sys$qio(1, channel, IO$_READVBLK, iosb, 0, 0, buffer, bufLen, 0, 0, 0, 0);&lt;BR /&gt;if (!(status&amp;amp;1)) return(status);&lt;BR /&gt;status = synch_with_timeout( 1, channel, iosb, timeout);&lt;BR /&gt;if (!(status&amp;amp;1)) return(status);&lt;BR /&gt;status = iosb[0];&lt;BR /&gt;return(status);</description>
      <pubDate>Wed, 20 May 2009 20:30:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-implement-timeout-with-sys-qio-in-tcp-ip-programming/m-p/4423702#M16664</guid>
      <dc:creator>Jess Goodman</dc:creator>
      <dc:date>2009-05-20T20:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to implement timeout with sys$qio in tcp ip programming</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-implement-timeout-with-sys-qio-in-tcp-ip-programming/m-p/4423703#M16665</link>
      <description>Ravikanth,&lt;BR /&gt;&lt;BR /&gt; You're nearly there!&lt;BR /&gt;&lt;BR /&gt;  Your timer AST just needs to $CANCEL(channel). If it fires before the $QIOW completes, it will cancel the I/O. You then cancel the timer and can check the IOSB to see if the I/O completed. SS$_ABORT or SS$_CANCEL indicate it was timed out.&lt;BR /&gt;&lt;BR /&gt;  $setimr(EFN$C_ENF,timout,cancel_io,TIMER_ID)&lt;BR /&gt;$qiow(EFN$C_ENF,channel,IO$_READVBLK,iosb,,,buffer,bufLen)&lt;BR /&gt;$cantim(TIMER_ID)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cancel_io looks like&lt;BR /&gt;  $cancel(channel)</description>
      <pubDate>Wed, 20 May 2009 21:32:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-implement-timeout-with-sys-qio-in-tcp-ip-programming/m-p/4423703#M16665</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2009-05-20T21:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to implement timeout with sys$qio in tcp ip programming</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/how-to-implement-timeout-with-sys-qio-in-tcp-ip-programming/m-p/4423704#M16666</link>
      <description>Hi Ravikanth,&lt;BR /&gt;&lt;BR /&gt;John G has the answer, but a slight addition maybe to use the address of channel as your timer id. That way it would be delivered as the first arg to your timer_routine that could then do a generic $cancel(inchan)&lt;BR /&gt;&lt;BR /&gt;Channel "value" otoh is probably not a very unique timer-id choice :-)&lt;BR /&gt;&lt;BR /&gt;Don't forget to check for ss$_abort and ss$_cancel statii.&lt;BR /&gt;&lt;BR /&gt;Cheers Richard Maher</description>
      <pubDate>Thu, 21 May 2009 00:37:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/how-to-implement-timeout-with-sys-qio-in-tcp-ip-programming/m-p/4423704#M16666</guid>
      <dc:creator>Richard J Maher</dc:creator>
      <dc:date>2009-05-21T00:37:16Z</dc:date>
    </item>
  </channel>
</rss>

