<?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: SYS$QIOW in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058030#M13193</link>
    <description>Rizwan,&lt;BR /&gt;&lt;BR /&gt;  It sounds to me like you're venturing into the exciting and potentially confusing world of "network protcols". That is, following a set of rules for a "conversation" between two systems exchanging messages. The BIG trick here is to know when to talk, when to listen, and how or when to decide that the party at the other end of the wire isn't following the rules. &lt;BR /&gt;&lt;BR /&gt;  Although it may SOUND simple enough, it isn't! What if you issue your $QIOW and the other end doesn't send anything? You just hang there waiting forever.&lt;BR /&gt;&lt;BR /&gt;  Sometimes it's simpler to code this kind of exchange as multi threaded, full duplex, listening at all times. Instead of $QIOW, use $QIO with a completion AST. That way your application isn't hanging around waiting, and you can handle unexpected messages arriving. On the other hand it does require careful coding.&lt;BR /&gt;&lt;BR /&gt;  At the very least, you should add a timeout to your reads to prevent waiting forever. Get hold of a textbook on network protocols so you can discover some of the tricks and traps, rather than discovering them for yourself.</description>
    <pubDate>Tue, 21 Aug 2007 20:31:33 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2007-08-21T20:31:33Z</dc:date>
    <item>
      <title>SYS$QIOW</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058025#M13188</link>
      <description>Iam using sys$qiow to read messages from the TCP socket. I read the message do some processing and then send the response back and close the socket. Now after I send the response back I have to receive another message and do futher processing before closing the socket. Do I have to do an another SYS$QIOW read to read the second time or will the message end up at the first sys$qiow call?</description>
      <pubDate>Tue, 21 Aug 2007 16:38:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058025#M13188</guid>
      <dc:creator>Rizwan Latheef</dc:creator>
      <dc:date>2007-08-21T16:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: SYS$QIOW</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058026#M13189</link>
      <description>Wnen you do a QIO[W] read operation, it tells&lt;BR /&gt;you how many bytes you got, and what those&lt;BR /&gt;bytes are.  If you want more bytes, you need&lt;BR /&gt;to do another read operation.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] or will the message end up at the&lt;BR /&gt;&amp;gt; first sys$qiow call?&lt;BR /&gt;&lt;BR /&gt;Messages go to buffers, not to function calls.&lt;BR /&gt;Do you mean, "Will the new bytes (for which I&lt;BR /&gt;haven't asked) magically appear somewhere in&lt;BR /&gt;some buffer, updating a byte count, one or&lt;BR /&gt;more status values, and various other things&lt;BR /&gt;in other places?"  No, I don't think so.</description>
      <pubDate>Tue, 21 Aug 2007 17:45:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058026#M13189</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-08-21T17:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: SYS$QIOW</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058027#M13190</link>
      <description>Rizwan,&lt;BR /&gt;&lt;BR /&gt;At a minimum, the call to SYS$QIOW must be executed a second time. Once an IO operation has completed, it is finished.&lt;BR /&gt;&lt;BR /&gt;Your code can certainly re-execute the SYS$QIOW call, provided that all of the parameters are appropriate.&lt;BR /&gt;&lt;BR /&gt;I would suggest examining some of the examples in the documentation set for both TCP package and the general OpenVMS documentation kit.&lt;BR /&gt;&lt;BR /&gt;- Bob Gezelter, &lt;A href="http://www.rlgsc.com" target="_blank"&gt;http://www.rlgsc.com&lt;/A&gt;</description>
      <pubDate>Tue, 21 Aug 2007 17:50:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058027#M13190</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2007-08-21T17:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: SYS$QIOW</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058028#M13191</link>
      <description>Theres usually good examples in the &lt;BR /&gt;sys$examples area under tcpip, that show&lt;BR /&gt;qio processing.  Dean</description>
      <pubDate>Tue, 21 Aug 2007 18:31:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058028#M13191</guid>
      <dc:creator>Dean McGorrill</dc:creator>
      <dc:date>2007-08-21T18:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: SYS$QIOW</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058029#M13192</link>
      <description>If you're familiar with it, $qio[w] is equivalent of ioctl or other low-level I/O call.  For most cases, $qio[w] is a one-shot operation.  And yes, you'll need to requeue for each wad of data.  Various folks will code this sequence as an AST-based loop.&lt;BR /&gt;&lt;BR /&gt;One subtlety of TCP and messages; you must be careful with the concept of packets or messages.  &lt;BR /&gt;&lt;BR /&gt;Within TCP, there are no units of "packets."  There are no "messages."  Meaning you might have to perform multiple $qio[w] calls to (re)assemble what you want to process as a message.&lt;BR /&gt;&lt;BR /&gt;TCP is a stream of data, and you might get a single byte at a time, or you might get multiples of your messages.  Don't treat it and don't assume it's a datagram protocol.  Subtle errors can arise if you do.&lt;BR /&gt;&lt;BR /&gt;This behavior is expected and intentional, but only tends to show up when the application or the system or the network is under stress.  And if the application isn't coded to deal with the characters, you can end up with "torn" or otherwise corrupted "messages."&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Aug 2007 19:37:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058029#M13192</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-08-21T19:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: SYS$QIOW</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058030#M13193</link>
      <description>Rizwan,&lt;BR /&gt;&lt;BR /&gt;  It sounds to me like you're venturing into the exciting and potentially confusing world of "network protcols". That is, following a set of rules for a "conversation" between two systems exchanging messages. The BIG trick here is to know when to talk, when to listen, and how or when to decide that the party at the other end of the wire isn't following the rules. &lt;BR /&gt;&lt;BR /&gt;  Although it may SOUND simple enough, it isn't! What if you issue your $QIOW and the other end doesn't send anything? You just hang there waiting forever.&lt;BR /&gt;&lt;BR /&gt;  Sometimes it's simpler to code this kind of exchange as multi threaded, full duplex, listening at all times. Instead of $QIOW, use $QIO with a completion AST. That way your application isn't hanging around waiting, and you can handle unexpected messages arriving. On the other hand it does require careful coding.&lt;BR /&gt;&lt;BR /&gt;  At the very least, you should add a timeout to your reads to prevent waiting forever. Get hold of a textbook on network protocols so you can discover some of the tricks and traps, rather than discovering them for yourself.</description>
      <pubDate>Tue, 21 Aug 2007 20:31:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sys-qiow/m-p/4058030#M13193</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2007-08-21T20:31:33Z</dc:date>
    </item>
  </channel>
</rss>

