<?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: Berkley Sockets Programming on VMS in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035745#M54299</link>
    <description>&lt;BR /&gt;&amp;gt;&amp;gt; Does anyone know why the "close(sockfd)" call would not work?&lt;BR /&gt;&lt;BR /&gt;One has to assume that the function itself normally does work, and thus suspect your program. Why does it not work for you?&lt;BR /&gt;A couple of potential causes in otrder of likelyhood...&lt;BR /&gt;1) because it is not called at all&lt;BR /&gt;2) because it is with the wrong argument? (value vs reference) &lt;BR /&gt;3) because it is called with the right argument at the wrong time? (busy io?)&lt;BR /&gt;&lt;BR /&gt;If dynamic, online, debugging is difficult, then I would be tempted to sprinkle is with some print statement: &lt;BR /&gt;- After each socket call to displaying the returned socket descriptor value, and possibly a timestamps (seconds?)&lt;BR /&gt;- Just before that close call, again dislaying the value of 'sockfd' (. &lt;BR /&gt;- After the close, the status and errno of that status = -1 ( EBADF ? EINTR ? )&lt;BR /&gt;... the program _does_ check the return value on the close right?&lt;BR /&gt;&lt;BR /&gt;And make those prints really adjacent, not a function level up!&lt;BR /&gt;&lt;BR /&gt;Good luck debugging.&lt;BR /&gt;&lt;BR /&gt;For further help you may want to attach a few snippets of code arounf the open and close calls and the parameters used by them&lt;BR /&gt;&lt;BR /&gt;I'm sure you know this, but all the function are in Help. For example:&lt;BR /&gt;$HELP TCPIP_SERVICES Programming_Interfaces Socket_API_Functions socket()&lt;BR /&gt;$HELP TCPIP_SERVICES Programming_Interfaces Socket_API_Functions close&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 22 Mar 2007 18:51:47 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2007-03-22T18:51:47Z</dc:date>
    <item>
      <title>Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035743#M54297</link>
      <description>I am writing a program to talk to a PC-base system using Berkley Sockets. My program runs until I get an error message that there are no more I/O channels. The debug messages indicate that the "close(sockfd)" call is not closing the socket connection. As the program loops, it creates a new socket and I eventually run out of I/O channels. Does anyone know why the "close(sockfd)" call would not work?</description>
      <pubDate>Thu, 22 Mar 2007 15:57:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035743#M54297</guid>
      <dc:creator>Patrick J. Henry</dc:creator>
      <dc:date>2007-03-22T15:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035744#M54298</link>
      <description>Bogus channel data in the argument?  There are various reasons.  Check the errno value, etc.</description>
      <pubDate>Thu, 22 Mar 2007 16:02:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035744#M54298</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-03-22T16:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035745#M54299</link>
      <description>&lt;BR /&gt;&amp;gt;&amp;gt; Does anyone know why the "close(sockfd)" call would not work?&lt;BR /&gt;&lt;BR /&gt;One has to assume that the function itself normally does work, and thus suspect your program. Why does it not work for you?&lt;BR /&gt;A couple of potential causes in otrder of likelyhood...&lt;BR /&gt;1) because it is not called at all&lt;BR /&gt;2) because it is with the wrong argument? (value vs reference) &lt;BR /&gt;3) because it is called with the right argument at the wrong time? (busy io?)&lt;BR /&gt;&lt;BR /&gt;If dynamic, online, debugging is difficult, then I would be tempted to sprinkle is with some print statement: &lt;BR /&gt;- After each socket call to displaying the returned socket descriptor value, and possibly a timestamps (seconds?)&lt;BR /&gt;- Just before that close call, again dislaying the value of 'sockfd' (. &lt;BR /&gt;- After the close, the status and errno of that status = -1 ( EBADF ? EINTR ? )&lt;BR /&gt;... the program _does_ check the return value on the close right?&lt;BR /&gt;&lt;BR /&gt;And make those prints really adjacent, not a function level up!&lt;BR /&gt;&lt;BR /&gt;Good luck debugging.&lt;BR /&gt;&lt;BR /&gt;For further help you may want to attach a few snippets of code arounf the open and close calls and the parameters used by them&lt;BR /&gt;&lt;BR /&gt;I'm sure you know this, but all the function are in Help. For example:&lt;BR /&gt;$HELP TCPIP_SERVICES Programming_Interfaces Socket_API_Functions socket()&lt;BR /&gt;$HELP TCPIP_SERVICES Programming_Interfaces Socket_API_Functions close&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Mar 2007 18:51:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035745#M54299</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-22T18:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035746#M54300</link>
      <description>Patrick,&lt;BR /&gt;&lt;BR /&gt;  Use SDA (ANALYZE/SYSTEM) to look at what channels your program is using:&lt;BR /&gt;&lt;BR /&gt;$ ANALYZE/SYSTEM&lt;BR /&gt;SDA&amp;gt; SET PROCESS/INDEX=pid&lt;BR /&gt;SDA&amp;gt; SHOW PROCESS/CHANNEL&lt;BR /&gt;&lt;BR /&gt;  At the least, you can confirm that it's the IP sockets you're running out of. Consider there may be other consumers of channels in the loop that you didn't notice.&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Mar 2007 20:08:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035746#M54300</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2007-03-22T20:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035747#M54301</link>
      <description>Patrick,&lt;BR /&gt;&lt;BR /&gt;WADU, Occam's Razor would seem to indicate that the calls to close have a problem.&lt;BR /&gt;&lt;BR /&gt;I would recommend adding debugging output to the open and close calls to check the returns and parameters.&lt;BR /&gt;&lt;BR /&gt;The most common C error is de-referencing. Are you sure that your program is actually passing the correct channel number to close?&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>Thu, 22 Mar 2007 23:02:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035747#M54301</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2007-03-22T23:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035748#M54302</link>
      <description>&lt;!--!*#--&gt;Good morning all:&lt;BR /&gt;&lt;BR /&gt;Here is the latest.  I stripped down the program to include only the socket() call and the close() call. Since my favorite way of debugging on a VAX is thru print statements, here is the output of my little program.&lt;BR /&gt;&lt;BR /&gt;SO1CP1$ run testopenclose&lt;BR /&gt;02/23/2007 06:31:36 Test: Created sockfd = 144&lt;BR /&gt;02/23/2007 06:31:36 Test: Failed to close connection: bad file number&lt;BR /&gt;02/23/2007 06:31:36 Test: Close socket = close(144)&lt;BR /&gt;02/23/2007 06:31:36 Test: errno = 9&lt;BR /&gt;&lt;BR /&gt;errno = 9 = EBADF&lt;BR /&gt;&lt;BR /&gt;After 30 years of programming, you would think that I would be able to write a program that creates a socket and then closes it successfully !&lt;BR /&gt;&lt;BR /&gt;So, how can the socket file descriptor get "bad" even when I don't do anything with it?  The socket descriptor is an "int". Its value after the socket() it he same as is used in the close() call. This program is simple and it should work, but it doesn't.&lt;BR /&gt;&lt;BR /&gt;Please ignore the fact that the VAX has not, as yet, sprung forward for Day Light Savings.</description>
      <pubDate>Fri, 23 Mar 2007 07:47:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035748#M54302</guid>
      <dc:creator>Patrick J. Henry</dc:creator>
      <dc:date>2007-03-23T07:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035749#M54303</link>
      <description>[...] you would think [...]&lt;BR /&gt;&lt;BR /&gt;Perhaps I would, and perhaps I wouldn't.&lt;BR /&gt;Without seeing the program, and how it was&lt;BR /&gt;compiled and linked, I probably wouldn't&lt;BR /&gt;think very much.</description>
      <pubDate>Fri, 23 Mar 2007 08:02:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035749#M54303</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-03-23T08:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035750#M54304</link>
      <description>&lt;!--!*#--&gt;PS - Here are the messages that were on the console this morning when I got in.&lt;BR /&gt;&lt;BR /&gt;{date &amp;amp; timestamp} Failed to create socket: non-translatable vms error code: 0x1B4, vms message: %SYSTEM-F-NOIOCHAN, no i/o channel available&lt;BR /&gt;%NONAME-F-NOMSG, message number 00000002&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Mar 2007 08:05:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035750#M54304</guid>
      <dc:creator>Patrick J. Henry</dc:creator>
      <dc:date>2007-03-23T08:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035751#M54305</link>
      <description>Patrick,&lt;BR /&gt;&lt;BR /&gt;Please post the source code for your sample program.&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>Fri, 23 Mar 2007 08:10:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035751#M54305</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2007-03-23T08:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035752#M54306</link>
      <description>&lt;!--!*#--&gt;Here is the plain and simple "testopenclose.c" program.&lt;BR /&gt;&lt;BR /&gt;#include &lt;IN.H&gt;             /* define internet related constants,   */&lt;BR /&gt;                            /* functions, and structures.           */&lt;BR /&gt;#include &lt;INET.H&gt;           /* define network address information   */&lt;BR /&gt;#include &lt;NETDB.H&gt;          /* define network database library info */&lt;BR /&gt;#include &lt;SOCKET.H&gt;         /* define BSD socket api.               */&lt;BR /&gt;#include &lt;STDIO.H&gt;          /* define standard io functions.        */&lt;BR /&gt;#include &lt;STDLIB.H&gt;         /* define standard library functions.   */&lt;BR /&gt;#include &lt;STRING.H&gt;         /* define string handling furnctions.   */&lt;BR /&gt;#include &lt;SIGNAL.H&gt;         /* needed for the SLEEP function.       */&lt;BR /&gt;#include &lt;UNIXIO.H&gt;&lt;BR /&gt;#include &lt;ERRNO.H&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;        int     sockfd;&lt;BR /&gt;        char    strDateTime[24];&lt;BR /&gt;        char    strPerrorMsg[256];&lt;BR /&gt;&lt;BR /&gt;  /*&lt;BR /&gt;   * get the current date and time stamp for use on output messages.&lt;BR /&gt;   */&lt;BR /&gt;  getCurrentTime (strDateTime);&lt;BR /&gt;&lt;BR /&gt;  /*&lt;BR /&gt;         * create a socket&lt;BR /&gt;         */&lt;BR /&gt;        if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) &amp;lt; 0 )&lt;BR /&gt;        {&lt;BR /&gt;   strcpy (strPerrorMsg, strDateTime);&lt;BR /&gt;            strcat (strPerrorMsg, "Test: Failed to create socket");&lt;BR /&gt;            perror (strPerrorMsg);&lt;BR /&gt;            exit (EXIT_FAILURE);&lt;BR /&gt;        }&lt;BR /&gt;        printf ("%sTest: Created sockfd = %d\n", strDateTime, sockfd);&lt;BR /&gt;&lt;BR /&gt;  /*&lt;BR /&gt;         * close a socket&lt;BR /&gt;         */&lt;BR /&gt;  if ( close (sockfd) &amp;lt; 0 ) &lt;BR /&gt;        {&lt;BR /&gt;   strcpy (strPerrorMsg, strDateTime);&lt;BR /&gt;            strcat (strPerrorMsg, "Test: Failed to close connection");&lt;BR /&gt;            perror (strPerrorMsg);&lt;BR /&gt;            printf ("%sTest: Close socket = close(%d)\n", strDateTime, sockfd);&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;  printf ("%sTest: errno = %d\n", strDateTime, errno);&lt;BR /&gt;&lt;BR /&gt;  exit (EXIT_SUCCESS);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And here is how I compile and link it:&lt;BR /&gt;SO1CP1$ type buildtestopenclose.com&lt;BR /&gt;$!&lt;BR /&gt;$ cc testopenclose.c /obj=*.obj&lt;BR /&gt;$ LINK  testopenclose.OBJ,-&lt;BR /&gt;        getCurrentTime.obj,-&lt;BR /&gt;        TCPIP$LIBRARY:TWGLIB.OLB/LIB,-&lt;BR /&gt;        OI:OILLIB.OLB/LIB,SS:SSLIB.OLB/LIB -&lt;BR /&gt;        /EXE=testopenclose.EXE&lt;BR /&gt;$!&lt;BR /&gt;&lt;BR /&gt;I would definitely appreciate any help I can get. I contracting with a company and my contract is over at the end of March. I would like to leave knowing this program works.&lt;/ERRNO.H&gt;&lt;/UNIXIO.H&gt;&lt;/SIGNAL.H&gt;&lt;/STRING.H&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;&lt;/SOCKET.H&gt;&lt;/NETDB.H&gt;&lt;/INET.H&gt;&lt;/IN.H&gt;</description>
      <pubDate>Fri, 23 Mar 2007 08:21:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035752#M54306</guid>
      <dc:creator>Patrick J. Henry</dc:creator>
      <dc:date>2007-03-23T08:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035753#M54307</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] TCPIP$LIBRARY:TWGLIB.OLB [...]&lt;BR /&gt;&lt;BR /&gt;HOLY COW!  There's a blast from the past.&lt;BR /&gt;&lt;BR /&gt;Have you tried plain-old LINK?&lt;BR /&gt;&lt;BR /&gt;alp $ cc TESTOPENCLOSE.C&lt;BR /&gt;&lt;BR /&gt;         getCurrentTime (strDateTime);&lt;BR /&gt;.........^&lt;BR /&gt;%CC-I-IMPLICITFUNC, In this statement, the identifier "getCurrentTime" is implic&lt;BR /&gt;itly declared as a function.&lt;BR /&gt;at line number 24 in file ALP$DKA0:[SMS]TESTOPENCLOSE.C;1&lt;BR /&gt;alp $ link TESTOPENCLOSE&lt;BR /&gt;%LINK-W-NUDFSYMS, 1 undefined symbol:&lt;BR /&gt;%LINK-I-UDFSYM,         GETCURRENTTIME&lt;BR /&gt;%LINK-W-USEUNDEF, undefined symbol GETCURRENTTIME referenced&lt;BR /&gt;        in psect $LINK$ offset %X00000090&lt;BR /&gt;        in module TESTOPENCLOSE file ALP$DKA0:[SMS]TESTOPENCLOSE.OBJ;2&lt;BR /&gt;&lt;BR /&gt;Note the lack of unresolved socket() stuff?&lt;BR /&gt;&lt;BR /&gt;Unless you're actually using the Wollongong/&lt;BR /&gt;Attachmate PathWay TCP/IP product, that is.&lt;BR /&gt;&lt;BR /&gt;The full explanation of the misbehavior&lt;BR /&gt;involves the implementation of socket() and&lt;BR /&gt;friends in the PathWay run-time stuff.</description>
      <pubDate>Fri, 23 Mar 2007 08:33:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035753#M54307</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-03-23T08:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035754#M54308</link>
      <description>Patrick,&lt;BR /&gt;&lt;BR /&gt;Beyond your program:&lt;BR /&gt;- What architecture are you using? (VAX/ALPHA/IA-64)&lt;BR /&gt;- What Version of the system are you using?&lt;BR /&gt;- What IP stack are you using?&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>Fri, 23 Mar 2007 08:38:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035754#M54308</guid>
      <dc:creator>Robert Gezelter</dc:creator>
      <dc:date>2007-03-23T08:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035755#M54309</link>
      <description>Some fine print:&lt;BR /&gt;&lt;BR /&gt;You're either using the wrong (non-PathWay)&lt;BR /&gt;header files, or else you're using the wrong&lt;BR /&gt;(PathWay) TCP/IP run-time library.  It would&lt;BR /&gt;take me a while to check the details, but as&lt;BR /&gt;I recall, you'd need to be using netclose()&lt;BR /&gt;instead of plain close() with the PathWay&lt;BR /&gt;stuff.  (And netread() and netwrite() instead&lt;BR /&gt;of read() and write(), but recv() is ok.)  No&lt;BR /&gt;bets, however, as I haven't touched code like&lt;BR /&gt;that in a long time.</description>
      <pubDate>Fri, 23 Mar 2007 09:02:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035755#M54309</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-03-23T09:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035756#M54310</link>
      <description>That simpel test program (of course) works fine on my I64 OpenVMS 8.3 with NO special options on the link.&lt;BR /&gt;&lt;BR /&gt;All I changed was to add a dummy function:&lt;BR /&gt;getCurrentTime (char *strDateTime)&lt;BR /&gt;{&lt;BR /&gt;strcpy ( strDateTime, "Hein Test" );&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;I suspect you accidently used a 'socket' from one library and a 'close' from an other.&lt;BR /&gt;&lt;BR /&gt;I reccomend a to link with /MAP/CROSS to see where stuff is being resolved.&lt;BR /&gt;You may need some library re-ordering or /SELECT or explicit module inclusion.&lt;BR /&gt;&lt;BR /&gt;Forgot the old standby questions:&lt;BR /&gt;- Did this ever work for you?&lt;BR /&gt;- What changed recently?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein van den Heuvel&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Mar 2007 09:11:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035756#M54310</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-23T09:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035757#M54311</link>
      <description>&lt;!--!*#--&gt;The computer is a VAXstation 9000-40 circa 1993 running a "Plant Monitoring System" (PMS) software package by ABB (which ABB no longer supports!). So, it is a VAX architecture.&lt;BR /&gt;&lt;BR /&gt;Operating System VAX/VMS version 5.5-2&lt;BR /&gt;&lt;BR /&gt;I don't know how to find out what IP stack I am using. I never took a sys admin course.&lt;BR /&gt;&lt;BR /&gt;My customer is a power generation company, and as in all industrial environments, they run their computers until they die from obsolesence.&lt;BR /&gt;&lt;BR /&gt;I tried a plain link, but SOCKET was undefined.&lt;BR /&gt;SO1CP1$ link testopenclose.obj,getcurrenttime.obj&lt;BR /&gt;%LINK-W-NUDFSYMS, 1 undefined symbol:&lt;BR /&gt;%LINK-I-UDFSYM,         SOCKET &lt;BR /&gt;%LINK-W-USEUNDEF, undefined symbol SOCKET referenced&lt;BR /&gt;        in psect $CODE offset %X00000026&lt;BR /&gt;        in module TESTOPENCLOSE file SYS$SYSDEVICE:[PMS.DESIGNER.HENRY.CALDON]TESTOPENCLOSE.OBJ;7&lt;BR /&gt;&lt;BR /&gt;Using sockets, I have been able to :&lt;BR /&gt;1) create a socket&lt;BR /&gt;2) connect the socket to an IP address/Port #&lt;BR /&gt;3) write to my simulator&lt;BR /&gt;4) read data from my simulator&lt;BR /&gt;5) process the data to the PMS database&lt;BR /&gt;&lt;BR /&gt;But I can't close the socket. I am now thinking that I may have to rewrite the program to use QIO calls. The ABB PMS software package has programs which are using QIO calls. But since this computer is scheduled to be replaced in a couple of years, I wanted to write my program to use the least amount of VMS-specific code as possible. I am assuming that the replacement will be PC-based running Windows or Linux or some other Op Sys. Since, I am contracting with this company and my contract is up at the end of the month, I wanted to make the porting of my code by someone else as simple as possible.&lt;BR /&gt;&lt;BR /&gt;I will check into the netclose() call.  Thanks for all of the suggestions and ideas. And I am glad to have triggered some old, but fond, memories for some of you.&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Mar 2007 09:24:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035757#M54311</guid>
      <dc:creator>Patrick J. Henry</dc:creator>
      <dc:date>2007-03-23T09:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035758#M54312</link>
      <description>&lt;!--!*#--&gt;netclose() worked!!!&lt;BR /&gt;&lt;BR /&gt;SO1CP1$ @buildtestopenclose&lt;BR /&gt;SO1CP1$ run testopenclose&lt;BR /&gt;02/23/2007 08:30:39 Test: Created sockfd = 144&lt;BR /&gt;02/23/2007 08:30:39 Test: errno = 0&lt;BR /&gt;&lt;BR /&gt;Thank you all. This saves me from having to rewrite using QIO calls.&lt;BR /&gt;&lt;BR /&gt;Now I can run my "overnight" test to see how well my programs are doing.</description>
      <pubDate>Fri, 23 Mar 2007 09:35:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035758#M54312</guid>
      <dc:creator>Patrick J. Henry</dc:creator>
      <dc:date>2007-03-23T09:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035759#M54313</link>
      <description>&amp;gt;&amp;gt; I tried a plain link, but SOCKET was undefined.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Yeah... but if that is the full linker message, then CLOSE apparently _was_ resolved from somewhere. So you are picking up a wrong close. &lt;BR /&gt;&lt;BR /&gt;btw.. In the current DECC compiler, that socket and close call would actually call out to functions decc$socket and decc$close resolved in DECC$SHR&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Mar 2007 09:40:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035759#M54313</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-03-23T09:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035760#M54314</link>
      <description>&amp;gt; VAX/VMS version 5.5-2&lt;BR /&gt;&lt;BR /&gt;That was useful.  It's old enough to make&lt;BR /&gt;PathWay (formerly known as WIN/TCP) more&lt;BR /&gt;likely.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I don't know how to find out what IP stack&lt;BR /&gt;&amp;gt; I am using.&lt;BR /&gt;&lt;BR /&gt;Well, if you had some reason to specify&lt;BR /&gt;TWGLIB.OLB, I'd guess that&lt;BR /&gt;   SHOW LOGICAL TWG*&lt;BR /&gt;would say something.&lt;BR /&gt;&lt;BR /&gt;I'm working from memory here (because&lt;BR /&gt;starting up my VAXstation 2000 would take&lt;BR /&gt;such a long time), but you probably need to&lt;BR /&gt;fetch your header files from somewhere under&lt;BR /&gt;TWG$TCP:[NETDIST], which can be done in a&lt;BR /&gt;number of ways (CC /INCLUDE, among them).&lt;BR /&gt;&lt;BR /&gt;There may even be a *version*.exe around&lt;BR /&gt;there somewhere, which would identify it a&lt;BR /&gt;little more precisely.&lt;BR /&gt;&lt;BR /&gt;Kermit does this:&lt;BR /&gt;&lt;BR /&gt;[...]&lt;BR /&gt;#ifdef WINTCP&lt;BR /&gt;&lt;BR /&gt;#include &lt;ERRNO.H&gt;&lt;BR /&gt;#include &lt;SETJMP.H&gt;&lt;BR /&gt;#include &lt;SIGNAL.H&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;/*&lt;BR /&gt;  The WIN/TCP code path is the same as that for MultiNet.&lt;BR /&gt;  Only the routine names have changed ...&lt;BR /&gt;*/&lt;BR /&gt;#define socket_errno    errno&lt;BR /&gt;#define socket_read     netread&lt;BR /&gt;#define socket_ioctl    ioctl&lt;BR /&gt;#define socket_write    netwrite&lt;BR /&gt;#define socket_perror   win$perror&lt;BR /&gt;#define socket_close    netclose&lt;BR /&gt;&lt;BR /&gt;#else /* Not WINTCP */&lt;BR /&gt;[...]&lt;BR /&gt;&lt;BR /&gt;which should offer some clues.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [..,] fond [...]&lt;BR /&gt;&lt;BR /&gt;Well, PathWay (WIN/TCP) worked a lot better&lt;BR /&gt;then the DEC UCX product in those days, so I&lt;BR /&gt;was fond_er_ of it than some other things.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] I may have to rewrite the program to&lt;BR /&gt;&amp;gt; use QIO calls.&lt;BR /&gt;&lt;BR /&gt;I would try hard to avoid that.&lt;/SYS&gt;&lt;/SIGNAL.H&gt;&lt;/SETJMP.H&gt;&lt;/ERRNO.H&gt;</description>
      <pubDate>Fri, 23 Mar 2007 09:43:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035760#M54314</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-03-23T09:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035761#M54315</link>
      <description>In all likelyhood, you are slamming into some limit in whatever IP package is installed in this box.&lt;BR /&gt;&lt;BR /&gt;To extend what Hein has written, get rid of those other libraries to start with (until and unless those are required by the particular IP stack installed on your OpenVMS system), and I'd also encourage a trip through the OpenVMS debugger -- the latter to get a better look at what the code is doing.&lt;BR /&gt;&lt;BR /&gt;In particular:&lt;BR /&gt;&lt;BR /&gt;$ cc testopenclose.c /DEBUG&lt;BR /&gt;$ cc getCurrentTime.c /DEBUG&lt;BR /&gt;$ LINK /DEBUG -&lt;BR /&gt;  /EXE=testopenclose.EXE -&lt;BR /&gt;  testopenclose.OBJ,-&lt;BR /&gt;  getCurrentTime.obj&lt;BR /&gt;$&lt;BR /&gt;       &lt;BR /&gt;The basic problem here is that software this old is not going to be easy to deal with, and it's not going to be portable.  Whatever documentation was available is likely long gone.  What you've got *should* work, so whatever IP package is here is not working as intended -- you may well be crossing routines from different packages or other such weirdness.&lt;BR /&gt;&lt;BR /&gt;I'd look at porting the code forward to a newer version, assuming the upgraded equivalent or alternative LPs are available.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://64.223.189.234/node/98" target="_blank"&gt;http://64.223.189.234/node/98&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;But that's not likely going to fit within the next month, save as a parallel effort to get the code moving on a more current release.  (That would be a fun and interesting project; factory floor stuff is seemingly always rather entertaining.)&lt;BR /&gt;&lt;BR /&gt;Porting forward is usually pretty easy, even with $qio calls and other such.  I haven't looked to see what packages and offerings are available from ABB, though BASEstar and other environments are certainly around.  &lt;BR /&gt;&lt;BR /&gt;Coding for portability is arguably a waste of your remaining time, at least until a decision is made to port forward or port to another platform.  (That grates, I know.  It bugs me too.  But low-level incremental retrofits of portability are not necessarily a good business case -- at least until you know that the code will be reused.)&lt;BR /&gt;&lt;BR /&gt;Here?  I'd use $qio given the schedule.   That unless I could find other code that uses the sockets -- and I might infer that the existing code used $qio because sockets didn't work in this old code.  Not a certainty; who knows what those original programmers knew.)&lt;BR /&gt;&lt;BR /&gt;Stephen Hoffman&lt;BR /&gt;HoffmanLabs&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Mar 2007 09:47:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035761#M54315</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-03-23T09:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Berkley Sockets Programming on VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035762#M54316</link>
      <description>One more dim recollection/guess:  That "144"&lt;BR /&gt;is a VMS channel number, which is why it&lt;BR /&gt;isn't closer to the 3, 4, 5, ... range, which&lt;BR /&gt;might be expected in this context.  And&lt;BR /&gt;that's why it made no sense to the normal C&lt;BR /&gt;RTL close().&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Thank you all.  [...]&lt;BR /&gt;&lt;BR /&gt;Where should I send the bill?</description>
      <pubDate>Fri, 23 Mar 2007 10:08:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/berkley-sockets-programming-on-vms/m-p/5035762#M54316</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-03-23T10:08:21Z</dc:date>
    </item>
  </channel>
</rss>

