<?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 Is close() required after using socket_fd() in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696511#M59926</link>
    <description>We have a network device is created with $assgn and mostly manipulated with $qio. Occasionally we need to use a function from the socket() library which does not have a $qio equivilent so we call decc$socket_fd() to associate a socket with the device.  &lt;BR /&gt;&lt;BR /&gt;When we're done with the device is it sufficient to call $dassgn to close the channel/device or do we also (or instead?) need to call close() on the result from socket_fd() to release some other internal structures which got created?&lt;BR /&gt;</description>
    <pubDate>Thu, 07 Oct 2010 11:15:13 GMT</pubDate>
    <dc:creator>Jeff44</dc:creator>
    <dc:date>2010-10-07T11:15:13Z</dc:date>
    <item>
      <title>Is close() required after using socket_fd()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696511#M59926</link>
      <description>We have a network device is created with $assgn and mostly manipulated with $qio. Occasionally we need to use a function from the socket() library which does not have a $qio equivilent so we call decc$socket_fd() to associate a socket with the device.  &lt;BR /&gt;&lt;BR /&gt;When we're done with the device is it sufficient to call $dassgn to close the channel/device or do we also (or instead?) need to call close() on the result from socket_fd() to release some other internal structures which got created?&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Oct 2010 11:15:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696511#M59926</guid>
      <dc:creator>Jeff44</dc:creator>
      <dc:date>2010-10-07T11:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is close() required after using socket_fd()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696512#M59927</link>
      <description>Um, which (missing) function?&lt;BR /&gt;&lt;BR /&gt;I wouldn't prefer to mix sockets and system service APIs.&lt;BR /&gt;&lt;BR /&gt;With strictly system services, $deassgn is enough.&lt;BR /&gt;&lt;BR /&gt;If you're going to try this mixing, then while I'd assume $deassgn is enough, I'd also write a test program and try a gazillion of whatever (missing) function might be (in a loop), and look for leaks.</description>
      <pubDate>Thu, 07 Oct 2010 12:52:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696512#M59927</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2010-10-07T12:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is close() required after using socket_fd()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696513#M59928</link>
      <description>The 'missing' function is select().&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 07 Oct 2010 12:58:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696513#M59928</guid>
      <dc:creator>Jeff44</dc:creator>
      <dc:date>2010-10-07T12:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is close() required after using socket_fd()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696514#M59929</link>
      <description>I have the suspicion socket_fd() is allocation memory, and $dassgn does not know of. Probably close() is the only place where this memory is returned.&lt;BR /&gt;&lt;BR /&gt; The 'missing' function is select().&lt;BR /&gt;&lt;BR /&gt;Using only VMS services select() is easily and more flexible replaced by a combination of async. $QIO, eventflags and/or ASTs, and either a wait for eventflags, or $hiber and awake from an AST.</description>
      <pubDate>Thu, 07 Oct 2010 13:09:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696514#M59929</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2010-10-07T13:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is close() required after using socket_fd()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696515#M59930</link>
      <description>If you really want to do a select() and to use an approach which is synchronous, clunky, and rather more work, then just use the event flags on the $qio and issue a wait.  &lt;BR /&gt;&lt;BR /&gt;That's more work and more code complexity and more support, for less features and slower code.  Use ASTs.  Or (if you need portability, which is less likely given the use of $qio) maybe threads.&lt;BR /&gt;&lt;BR /&gt;While a more modern C environment does threading and asynchronous processing rather easily, unfortunately C on VMS is rather stale.  Give you're already using the $qio calls, you can get where you want with this.&lt;BR /&gt;&lt;BR /&gt;Here's a generic AST example:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://labs.hoffmanlabs.com/node/617" target="_blank"&gt;http://labs.hoffmanlabs.com/node/617&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Though this is definitely a different application design approach for the code; this is event-driven code, rather than waiting for flags.  (Which might push you back into event flag waits via lib$get_ef calls and $qio calls and the $wflor and such.  Into the ancient select-style programming model.)  If the event-driven code is done "right", it's often rather cleaner than the old-style select-based stuff, too.&lt;BR /&gt;&lt;BR /&gt;Please consider not posting proposed solutions; certainly not in isolation.  Please post problems, and background.  If you should post a question on a particular solution, then you'll usually get an answer to that approach.  Here's the rub with asking specific questions: the specific answer you'll (usually) get means you might (will?) miss alternative (better) solutions to your actual problem.</description>
      <pubDate>Thu, 07 Oct 2010 13:49:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696515#M59930</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2010-10-07T13:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is close() required after using socket_fd()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696516#M59931</link>
      <description>I suppose I should have posted a more complete reply, its for a select() on an SSLified socket. We generally do use $QIO's for managing these things however when we're asked to enable SSL, the SSL library is socket based and so we need to switch to sockets.&lt;BR /&gt;&lt;BR /&gt;Thanks for all the useful comments, and the others as well. I'll write a test program which creates several sockets off a vms channel to see what happens when I close them.</description>
      <pubDate>Thu, 07 Oct 2010 14:54:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696516#M59931</guid>
      <dc:creator>Jeff44</dc:creator>
      <dc:date>2010-10-07T14:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is close() required after using socket_fd()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696517#M59932</link>
      <description>Ah, ssl.  Ye-hah.  I just did 2,000 lines of that stuff (commented C and DCL, key-generation, etc) to get that all working (simply) for a customer.&lt;BR /&gt;&lt;BR /&gt;On one of the other platforms I deal with, that same support is six or eight button-presses and some simple (provided) input forms to get the keys set-up, and probably ten lines of code. &lt;BR /&gt;&lt;BR /&gt;I feel your pain.</description>
      <pubDate>Thu, 07 Oct 2010 15:56:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696517#M59932</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2010-10-07T15:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is close() required after using socket_fd()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696518#M59933</link>
      <description>Would STUNNEL be of any use here?&lt;BR /&gt;&lt;BR /&gt;One port for in the clear access and another for SSL?&lt;BR /&gt;&lt;BR /&gt;Cheers Richard Maher</description>
      <pubDate>Thu, 07 Oct 2010 23:25:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696518#M59933</guid>
      <dc:creator>Richard J Maher</dc:creator>
      <dc:date>2010-10-07T23:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is close() required after using socket_fd()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696519#M59934</link>
      <description>&lt;BR /&gt;The OpenSSL library lets you supply your own BIO (buffered I/O) object for providing the communication stream that the SSL protocol runs over.  That's how the OSU web server supports SSL using $QIO interfaces to the TCP/IP stack.</description>
      <pubDate>Fri, 08 Oct 2010 21:54:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/is-close-required-after-using-socket-fd/m-p/4696519#M59934</guid>
      <dc:creator>David Jones_21</dc:creator>
      <dc:date>2010-10-08T21:54:39Z</dc:date>
    </item>
  </channel>
</rss>

