INFO-VAX Tue, 15 May 2007 Volume 2007 : Issue 266 Contents: How can I get scanf to terminate on when the buffer is empty? Re: How can I get scanf to terminate on when the buffer is empty? Re: How can I get scanf to terminate on when the buffer is empty? Re: How can I get scanf to terminate on when the buffer is empty? Re: How can I get scanf to terminate on when the buffer is empty? Re: How can I get scanf to terminate on when the buffer is empty? HP's PHP & OSU-Webserver? Re: Movie Promo for HP Partners Roundhouse in Nashua on Tuesday, May 22 Re: Movie Promo for HP Partners Roundhouse in Nashua on Tuesday, May 22 OT: Logikal Solutions Announces Logic Book Re: OT: Logikal Solutions Announces Logic Book Re: OT: Logikal Solutions Announces Logic Book Re: OT: Logikal Solutions Announces Logic Book OT: Polish language Re: OT: Polish language Re: OT: Polish language sanface txt2pdf comments Re: TCPIP 5.4 ECO 6: any problems? TCPIP programming (sockaddr_in question) Re: TCPIP programming (sockaddr_in question) TCPIP programming questions Re: TCPIP programming questions Re: TCPIP programming questions ---------------------------------------------------------------------- Date: 15 May 2007 04:15:25 -0700 From: Fatz Subject: How can I get scanf to terminate on when the buffer is empty? Message-ID: <1179227725.908916.139510@k79g2000hse.googlegroups.com> Hello, How can I get scanf to terminate on carriage-return when the buffer is empty? #include #include int main() { char buf[10]; printf("> "); if (scanf("%s", buf) == EOF) exit(1); if (strlen(buf) == 0) exit(1); } When I run this and hit return at the prompt, the new line is echoed and scanf keeps waiting for the string. How can I get scanf to terminate instead (other than using gets())? Thanks for any help, Fatz DEC C V5.6-003 on OpenVMS Alpha V7.3 ------------------------------ Date: Tue, 15 May 2007 13:51:57 +0200 From: Joseph Huber Subject: Re: How can I get scanf to terminate on when the buffer is empty? Message-ID: Fatz wrote: > How can I get scanf to terminate on carriage-return when the buffer is > empty? ... > char buf[10]; > printf("> "); > if (scanf("%s", buf) == EOF) exit(1); > if (strlen(buf) == 0) exit(1); > } > > When I run this and hit return at the prompt, the new line is echoed > and scanf keeps waiting for the string. How can I get scanf to > terminate instead (other than using gets())? > Whether Unix or VMS, I think You can't do it using scanf, gets is there to terminate on \n . Anyhow both gets and scanf are subject to buffer overrun, and the only save way is some kind of getchar() loop, counting characters until buffer full, and checking EOF,CR,LF, or better any control character to terminate. -- Joseph Huber - http://www.huber-joseph.de ------------------------------ Date: Tue, 15 May 2007 22:08:15 +1000 From: Jim Duff Subject: Re: How can I get scanf to terminate on when the buffer is empty? Message-ID: <4649a2b0$1@dnews.tpgi.com.au> Fatz wrote: > Hello, > > How can I get scanf to terminate on carriage-return when the buffer is > empty? > > #include > #include > > int main() > { > char buf[10]; > printf("> "); > if (scanf("%s", buf) == EOF) exit(1); > if (strlen(buf) == 0) exit(1); > } > > When I run this and hit return at the prompt, the new line is echoed > and scanf keeps waiting for the string. How can I get scanf to > terminate instead (other than using gets())? > > Thanks for any help, > > Fatz > DEC C V5.6-003 on OpenVMS Alpha V7.3 > You can't do this with the C standard library. You have a number of choices, most of which are covered in the C programming FAQ. See here: http://c-faq.com/osdep/cbreak.html For a SMG$ implementation example, see here: http://www.eight-cubed.com/examples/framework.php?file=sys_hash_pwd.c This example echoes stars as it's reading the password, but it should be obvious how to make it echo the pressed character. Cheers, Jim. -- www.eight-cubed.com ------------------------------ Date: Tue, 15 May 2007 12:15:32 +0000 (UTC) From: m.kraemer@gsi.de (Michael Kraemer) Subject: Re: How can I get scanf to terminate on when the buffer is empty? Message-ID: In article <1179227725.908916.139510@k79g2000hse.googlegroups.com>, Fatz writes: > Hello, > > How can I get scanf to terminate on carriage-return when the buffer is > empty? > > #include > #include > > int main() > { > char buf[10]; > printf("> "); > if (scanf("%s", buf) == EOF) exit(1); > if (strlen(buf) == 0) exit(1); > } > > When I run this and hit return at the prompt, the new line is echoed > and scanf keeps waiting for the string. How can I get scanf to > terminate instead (other than using gets())? > > Thanks for any help, > You might give fgets( buffer, number_of_bytes, stdin ); a try. It's better than gets() since you can specify the number of bytes in the buffer and thus avoid buffer overruns. Then test the scan buffer for the newline. If present, you're done. If not, increase buffer (realloc()) and read on. It's clumsy, but reasonably safe. ------------------------------ Date: Tue, 15 May 2007 14:26:32 +0200 From: Joseph Huber Subject: Re: How can I get scanf to terminate on when the buffer is empty? Message-ID: >> How can I get scanf to terminate on carriage-return when the buffer is >> empty? > ... >> char buf[10]; >> printf("> "); >> if (scanf("%s", buf) == EOF) exit(1); >> if (strlen(buf) == 0) exit(1); >> } >> >> When I run this and hit return at the prompt, the new line is echoed >> and scanf keeps waiting for the string. How can I get scanf to >> terminate instead (other than using gets())? >> > In addition to what has been said, I think there is fgets() in stdio: isn't that what You want ? -- Joseph Huber - http://www.huber-joseph.de ------------------------------ Date: Tue, 15 May 2007 12:34:11 -0400 From: JF Mezei Subject: Re: How can I get scanf to terminate on when the buffer is empty? Message-ID: <52b77$4649e11d$cef8887a$29997@TEKSAVVY.COM> Fatz wrote: > How can I get scanf to terminate on carriage-return when the buffer is > empty? > if (scanf("%s", buf) == EOF) exit(1); scanf will read/skip blank space until it finds a suitable string that fits the %s in your format. So in the end, I do not think that you can have scanf return an empty string. ------------------------------ Date: Tue, 15 May 2007 08:46:40 +0000 (UTC) From: gartmann@nonsense.immunbio.mpg.de (Christoph Gartmann) Subject: HP's PHP & OSU-Webserver? Message-ID: Hello, the subject says it all: is it possible to run HP's implementation of PHP under the OSU webserver? The OSU mailing list gave no answer :-( Regards, Christoph Gartmann -- Max-Planck-Institut fuer Phone : +49-761-5108-464 Fax: -452 Immunbiologie Postfach 1169 Internet: gartmann@immunbio dot mpg dot de D-79011 Freiburg, Germany http://www.immunbio.mpg.de/home/menue.html ------------------------------ Date: Tue, 15 May 2007 07:57:28 +0000 (UTC) From: david20@alpha2.mdx.ac.uk Subject: Re: Movie Promo for HP Partners Roundhouse in Nashua on Tuesday, May 22 Message-ID: In article , "Martin Vorlaender" writes: >Doc wrote: > >> JF Mezei wrote: >>> William Webb wrote: >>>> I'm not so sure that Blade Runner is such a good selection. >>>> Remember, OpenVMS turns 30 this year... >>> >>> Blade Runner !=3D Logan's Run. >[...] >>> Logan's Run is the one where a LED on people's hands lights up when >>> they reach 30 years of age and they must be disposed of. >>> >>> Blade Runner is about robots that get killed when they outlast their >>> programmed lifetime/warrantee. (if I remember correctly). >> >> You don't remember correctly. The robots in Blade runner expired at 30= >.. >> This detail wasn't particularly obvious in the original version of the= > >> movie. > >I don't remember exactly whether the expiration date was 30 or 4 years, >but wasn't BladeRunner sent on a hunt for a robot that *didn't* expire? > >I really have to read that book/watch that movie again... > In the film Blade Runner the replicants have made their way to Earth to find the head of the corporation which manufactured them in the hope that they can force him to extend their 4 year lifespan - which was built into them as a safety mechanism. In the book the 4 year lifespan comes about because their cells cannot be replaced as they deteriorate. see http://en.wikipedia.org/wiki/Do_Androids_Dream_of_Electric_Sheep and http://en.wikipedia.org/wiki/Blade_Runner The only special replicant is Rachael but her lifespan is still the same it is just that she has been implanted with the memories of a real person - the head of the Company's (Tyrell Corporation's) niece. Hence she initially believes she is Human. (Though there is some argument over whether Deckard the Blade Runner is himself a replicant similar to Rachael). David Webb Security team leader CCSS Middlesex University >cu, > Martin >-- = > >One OS to rule them all | Martin Vorlaender | OpenVMS rules! >One OS to find them | work: mv@pdv-systeme.de >One OS to bring them all | http://www.pdv-systeme.de/users/martin= >v/ >And in the Darkness bind them.| home: martin.vorlaender@t-online.de ------------------------------ Date: 15 May 2007 08:10:26 GMT From: Doc Subject: Re: Movie Promo for HP Partners Roundhouse in Nashua on Tuesday, May 22 Message-ID: david20@alpha2.mdx.ac.uk wrote in news:f2aupr$ek0$1@south.jnrs.ja.net: > In article , Doc > writes: >>JF Mezei wrote in news:eb849$46488d11 >>$cef8887a$6638@TEKSAVVY.COM: >> >>> William Webb wrote: >>>> I'm not so sure that Blade Runner is such a good selection. >>>> Remember, OpenVMS turns 30 this year... >>> >>> >>> Blade Runner != Logan's Run. >>> >>> Blade Runner was shot in HongKong, Logan's Run was shot in a newly >>built >>> shopping centre in Texas if I remember correctly. >>> >>> >>> Logan's Run is the one where a LED on people's hands lights up when >>they >>> reach 30 years of age and they must be disposed of. >>> >>> Blade Runner is about robots that get killed when they outlast their >>> programmed lifetime/warrantee. (if I remember correctly). >> >>You don't remember correctly. The robots in Blade runner expired at >>30. This detail wasn't particularly obvious in the original version >>of the movie. >> >>I suggest you go buy "Do Androids Dream of Electric Sheep", and as >>much other PKD as you can get your hands on. >> > Sorry in Blade Runner the lifetime of the Nexus-6 replicants was only > 4 years. See for instance > > http://www.mala.bc.ca/~soules/medi402/leanne/rachel.htm > > and > > http://scribble.com/uwi/br/br-faq.html I stand corrected, thanks for the links and apologies to JF. Doc. ------------------------------ Date: 15 May 2007 08:45:04 -0700 From: yyyc186@hughes.net Subject: OT: Logikal Solutions Announces Logic Book Message-ID: <1179243904.775113.99780@n59g2000hsh.googlegroups.com> This is slightly off-topic, but some of you have asked about it. There are mentions of VMS in it, but the book is not specific to OpenVMS. "The Minimum You Need to Know About Logic to Work in IT" Teaches newbies the long lost skills of flowcharting, pseudocoding, and how to solve problems without writing a single line of source. You can read more about it at http://theminimumyouneedtoknow.com. Thank you, Roland ------------------------------ Date: 15 May 2007 16:14:51 GMT From: bill@cs.uofs.edu (Bill Gunshannon) Subject: Re: OT: Logikal Solutions Announces Logic Book Message-ID: <5au4jrF2qi8v8U1@mid.individual.net> In article <1179243904.775113.99780@n59g2000hsh.googlegroups.com>, yyyc186@hughes.net writes: > This is slightly off-topic, but some of you have asked about it. > There are mentions of VMS in it, but the book is not specific to > OpenVMS. > > "The Minimum You Need to Know About Logic to Work in IT" > > Teaches newbies the long lost skills of flowcharting, pseudocoding, > and how to solve problems without writing a single line of source. > You can read more about it at http://theminimumyouneedtoknow.com. Don't quit your day job!! If your book get's the reception I got when I brought in some of the "tools of the trade" from my professional programming days to show the faculty here you will probably never need a second run. :-( You see, we have a graduate program in Software Engineering here and I wanted to show how we did so much more back before the term "Software Engineering" was even a gleam in some "professor at CMU"'s eye. I was regaled with explanations about how none of that was really necessary. What had I brought in? Flow Charting Template, HIPO (Hierarchical Input Porcess Output) Charts, Printer Layout Design Sheets, Terminal Layout Design Sheets, Pseudo-Coding Sheets, Language Specific Coding Forms, etc. We spent days working on a program before we entered the first character into an editor. Today, the students get an assignment in class and head immediately to the lab where they begin typing in their program. And this is called "Software Engineering". Sigh....... bill -- Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves bill@cs.scranton.edu | and a sheep voting on what's for dinner. University of Scranton | Scranton, Pennsylvania | #include ------------------------------ Date: 15 May 2007 09:30:56 -0700 From: Ian Miller Subject: Re: OT: Logikal Solutions Announces Logic Book Message-ID: <1179246656.320332.311650@k79g2000hse.googlegroups.com> In my first job I had to write a detailed design, get it approved, write the code, get to assemble without errors then submit it for review before being allowed to link it and test it. Debugging was performed at the desk with a listing from the last test run and a listing of the program. debugging at a terminal was considered a bad thing and not only due to the small number of terminals compared to the number of programmers wanting to use them. Painful and tedious at times - yes but excellent training. See http://theminimumyouneedtoknow.com/logic_in_IT_book_excerpt.html for an extract. I also see Chapter 6 should be required reading for some people around these parts http://theminimumyouneedtoknow.com/logic_in_IT_book_excerpt.html ------------------------------ Date: Tue, 15 May 2007 13:24:38 -0400 From: "Richard B. Gilbert" Subject: Re: OT: Logikal Solutions Announces Logic Book Message-ID: <4649ECD6.70308@comcast.net> Bill Gunshannon wrote: > In article <1179243904.775113.99780@n59g2000hsh.googlegroups.com>, > yyyc186@hughes.net writes: > >>This is slightly off-topic, but some of you have asked about it. >>There are mentions of VMS in it, but the book is not specific to >>OpenVMS. >> >>"The Minimum You Need to Know About Logic to Work in IT" >> >>Teaches newbies the long lost skills of flowcharting, pseudocoding, >>and how to solve problems without writing a single line of source. >>You can read more about it at http://theminimumyouneedtoknow.com. > > > Don't quit your day job!! > > If your book get's the reception I got when I brought in some of > the "tools of the trade" from my professional programming days to > show the faculty here you will probably never need a second run. :-( > > > You see, we have a graduate program in Software Engineering here > and I wanted to show how we did so much more back before the term > "Software Engineering" was even a gleam in some "professor at CMU"'s > eye. I was regaled with explanations about how none of that was > really necessary. What had I brought in? Flow Charting Template, > HIPO (Hierarchical Input Porcess Output) Charts, Printer Layout > Design Sheets, Terminal Layout Design Sheets, Pseudo-Coding Sheets, > Language Specific Coding Forms, etc. We spent days working on a > program before we entered the first character into an editor. Today, > the students get an assignment in class and head immediately to the > lab where they begin typing in their program. And this is called > "Software Engineering". Sigh....... > > bill > I used to write perfectly good programs without doing a flowchart, or a HIPO chart. I will admit to occasionally using Printer Layout design sheets; they can be a big help in getting columns to line up with headings and that sort of thing. Flowcharts can sometimes help document a program but they are not always necessary before writing one. OTOH, sometimes all these "software engineering" tools can be a big help. If more than one person is doing the coding, they can be essential. Much depends on the complexity of the task and the size of the team doing the design and coding. ------------------------------ Date: Tue, 15 May 2007 16:49:29 +0200 From: Marcin 'Rambo' Roguski Subject: OT: Polish language Message-ID: <20070515164929.f50c37ad.m_roguski@yahoo.com> > For me, at least, any foreign language is murderous to learn. Some,=20 > however, are more murderous than others. I'm told that Polish does not=20 > have prepositions; "on the table", "under the table", "beside the > table" are all done with inflections of "table". Not really, in fact there are prepositions, but the difference is in=20 declination (as in Latin, for example), we have "przed, pod, nad, za" (in front of, under, on, behind). but the noun's pronounciation changes as well: so we have st=F3=B3 (change to ISO 8859-2 to see the proper letter= s, =F3 is like English "oo", =B3 is like English "w"). So we have - przed sto=B3em (in front of the table) - pod sto=B3em (under the table) - na stole (on the table) - przy stole, obok sto=B3u (by/beside the table) > And then there's the > matter of pronunciation: "przb", "przm", and "przw" are completely > beyond me! I don't think "sczc" is Polish but I have the same > problem. . . . It is, but if you can pronounce sh and ch, you shouldn't have problem. Much as sz=3D sh, cz=3D ch: rz =3D "slow attack" j. It's very unusual that there are such combinations of 4 consonants like=20 you cited, normally you'd have a vocal after these, like przyb-, przem-,=20 przyw-, and there are just handful of words that you know your tongue=20 like this. As for the last: you probably think about Szczecin, pronounced Shchetsin (ci is pronounced as one letter, like in much) And that concludes educative portion of this thread, Rambo ------------------------------ Date: Tue, 15 May 2007 11:01:24 -0400 From: "Richard B. Gilbert" Subject: Re: OT: Polish language Message-ID: <4649CB44.1060103@comcast.net> Marcin 'Rambo' Roguski wrote: >>For me, at least, any foreign language is murderous to learn. Some, >>however, are more murderous than others. I'm told that Polish does not >>have prepositions; "on the table", "under the table", "beside the >>table" are all done with inflections of "table". > > > Not really, in fact there are prepositions, but the difference is in > declination (as in Latin, for example), we have "przed, pod, nad, za" > (in front of, under, on, behind). but the noun's pronounciation changes > as well: so we have stó³ (change to ISO 8859-2 to see the proper letters, > ó is like English "oo", ³ is like English "w"). > So we have > - przed sto³em (in front of the table) > - pod sto³em (under the table) > - na stole (on the table) > - przy stole, obok sto³u (by/beside the table) > > >>And then there's the >>matter of pronunciation: "przb", "przm", and "przw" are completely >>beyond me! I don't think "sczc" is Polish but I have the same >>problem. . . . > > > It is, but if you can pronounce sh and ch, you shouldn't have problem. > Much as sz= sh, cz= ch: rz = "slow attack" j. I can, of course, pronounce "sh" and "ch" but not "shch"; I need a vowel or two! > > It's very unusual that there are such combinations of 4 consonants like > you cited, normally you'd have a vocal after these, like przyb-, przem-, > przyw-, and there are just handful of words that you know your tongue > like this. ISTR someone here signing himself "Przmol" ------------------------------ Date: Tue, 15 May 2007 07:52:27 -0700 From: "Tom Linden" Subject: Re: OT: Polish language Message-ID: On Tue, 15 May 2007 08:01:24 -0700, Richard B. Gilbert wrote: > Marcin 'Rambo' Roguski wrote: >>> For me, at least, any foreign language is murderous to learn. Some, >>> however, are more murderous than others. I'm told that Polish does >>> not have prepositions; "on the table", "under the table", "beside the >>> table" are all done with inflections of "table". >> Not really, in fact there are prepositions, but the difference is in >> declination (as in Latin, for example), we have "przed, pod, nad, za" >> (in front of, under, on, behind). but the noun's pronounciation changes >> as well: so we have stół (change to ISO 8859-2 to see the proper >> letters, >> ó is like English "oo", Å‚ is like English "w"). >> So we have >> - przed stoÅ‚em (in front of the table) >> - pod stoÅ‚em (under the table) >> - na stole (on the table) >> - przy stole, obok stoÅ‚u (by/beside the table) >> >>> And then there's the >>> matter of pronunciation: "przb", "przm", and "przw" are completely >>> beyond me! I don't think "sczc" is Polish but I have the same >>> problem. . . . >> It is, but if you can pronounce sh and ch, you shouldn't have problem. >> Much as sz= sh, cz= ch: rz = "slow attack" j. > > I can, of course, pronounce "sh" and "ch" but not "shch"; I need a vowel > or two! cabbage cheese, last phonem of the first word with first of the second, now try to isolate them. > > >> It's very unusual that there are such combinations of 4 consonants >> like you cited, normally you'd have a vocal after these, like przyb-, >> przem-, przyw-, and there are just handful of words that you know your >> tongue like this. > > ISTR someone here signing himself "Przmol" > -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ ------------------------------ Date: Tue, 15 May 2007 14:44:35 GMT From: "Jerry Alan Braga" Subject: sanface txt2pdf comments Message-ID: Is anyone using this out there in openVMS 8.3 on alpha land. I currently have the need to convert txt to pdf documents including adding watermarks etc. I am using a different utility I found for vms but it is very basic and cannot adder background watermarks etc. I also need one from some of my windows apps being perl I could run it on both. Any comments or suggestions, thanks ------------------------------ Date: Tue, 15 May 2007 07:35:03 +0000 (UTC) From: helbig@astro.multiCLOTHESvax.de (Phillip Helbig---remove CLOTHES to reply) Subject: Re: TCPIP 5.4 ECO 6: any problems? Message-ID: In article <31jmh4-esm.ln1@news.hus-software.de>, Albrecht Schlosser writes: > >> DEC AXPVMS TCPIP_ECO V5.4-156 Patch Install 22-SEP-2006 16:11:25 0 SYSTEM > >> > >> So it's apparently been working for me for a while. As I recall, the > >> problems involved systems which were _not_ using DNS, > > > > IIRC, it wasn't working if the hostname was obtained from the local > > hosts database, rather than via a DNS lookup. > > TRUE, I ran into this problem. Be warned ! > > > Presumably one could do a > > SHOW HOST and get the IP address and then do the ping, so it wouldn't be > > a show-stopper, unless things other than ping had similar problems. > > I don't think that this works, and this really is of no use, if you need > to resolve host names from the local host database (in a program, using > standard socket calls like gethostbyname). I have no need for that. Presumably, it affects not just ping but any use of resolving a local host name to an IP address, right? If I have a need to connect from one node to another, I normally use LAT, not TELNET (DECnet would also be a possibility, but I don't have it running). Since I have a "shared everything" cluster, normally it doesn't matter what node I am logged in to and thus there is no need to connect to another node. At most, within my local network I would use PING for trouble-shooting or connect with a web browser to my router. If I forget an IP address, I assume TCPIP SHOW HOST would still work. My program to update my dynamic DNS (due to a volatile IP address) DOES do IP on the LAN (queries the router for its WAN address), using a DCL procedure and LYNX -dump in a batch job. However, I could replace the name with the IP address and even that would still work. > However, there is a fix: you can use one image file from ECO 5 and replace > the ECO 6 image (there has been an article on ITRC). This _one_ > image file is used under two names, however: > > "This is a regression in the bind resolver code. The problem could be avoided if > one used the $IPC_SHR.EXE image from ECO5. Of course that is an > unsupported thing to do." OK. This has been mentioned here before and apparently solves the problem with no bad side effects. > I googled this using "itrc local host ucx eco6" (one match): > > http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1057983 > > On the production system, we didn't install ECO6, but on a test system we > used this fix, and it seemed to work so far (it solved the problem). But > I don't know if there are other bugs with this unsopported fix. It would be nice to hear from VMS engineering that this is OK, even if it is not supported. > I'm really surprised that this broken ECO is still on ITRC, although it > has been discussed in the ITRC forum ... :-( :-( Indeed. How many qualified VMS engineers has HP gotten rid of lately? This is obviously one of the effects. HP, pushing VMS as an enterprise-level operating system, has a known problem with a potential patch, which could be an absolute show-stopper for many people. There is no mention of this problem in the release notes for the patch on the ITRC site. And the problem has been known (and discussed) for months. This is the level of patch quality one has come to expect for, say, Windows, not VMS. It can't even be THAT big of a problem to solve. What's going on? HP, HP, why have you forsaken us? Sic transit gloria mundi. ------------------------------ Date: Tue, 15 May 2007 15:02:18 GMT From: VAXman- @SendSpamHere.ORG Subject: TCPIP programming (sockaddr_in question) Message-ID: <00A67A68.F7818E9B@SendSpamHere.ORG> There are several definitions for sockaddrin found in TCPIP$INETDEF for HP TCP/IP Services for OpenVMS Alpha Version V5.6 TCPIP$INETDEF.MAR (Macro): .MACRO $SOCKADDRINDEF,$GBL $DEFINI SOCKADDRIN,$GBL $EQU SIN$C_LENGTH 16 $EQU SIN$K_LENGTH 16 $EQU SIN$S_SOCKADDRIN 16 $EQU SIN$W_FAMILY 0 ; address family $EQU SIN$W_PORT 2 ; 2 bytes specifying a port $EQU SIN$L_ADDR 4 ; 4 bytes specifying an IP address $EQU SIN$S_ZERO 8 $EQU SIN$T_ZERO 8 ; 8 bytes $EQU SIN44$C_LENGTH 16 $EQU SIN44$K_LENGTH 16 $EQU SIN44$S_SOCKADDRIN44 16 $EQU SIN44$B_LEN 0 $EQU SIN44$B_FAMILY 1 $EQU SIN44$W_PORT 2 ; 2 bytes specifying a port $EQU SIN44$L_ADDR 4 ; 4 bytes specifying an IP address $EQU SIN44$S_ZERO 8 $EQU SIN44$T_ZERO 8 ; 8 bytes $EQU SIN6$K_LENGTH 28 ; Structure size $EQU SIN6$C_LENGTH 28 ; Structure size $EQU SIN6$B_LEN 0 ; length of this struct $EQU SIN6$B_FAMILY 1 ; AF_INET6 $EQU SIN6$W_PORT 2 ; Transport layer port # $EQU SIN6$L_FLOWLABEL 4 ; IPv6 flow information $EQU SIN6$S_ADDR 16 $EQU SIN6$T_ADDR 8 $EQU SIN6$S_SA6_ADDR 16 $EQU SIN6$B_SA6_ADDR 8 $EQU SIN6$S_SA6_WADDR 16 $EQU SIN6$W_SA6_WADDR 8 $EQU SIN6$S_SA6_LADDR 16 $EQU SIN6$L_SA6_LADDR 8 $EQU SIN6$S_SA6_QADDR 16 $EQU SIN6$Q_SA6_QADDR 8 $EQU SIN6$L_SCOPE_ID 24 ; set of interfaces for a scope $DEFEND SOCKADDRIN,$GBL,DEF .ENDM TCPIP$INETDEF.H (C Header): #pragma __member_alignment __save #pragma __nomember_alignment #define SIN$C_LENGTH 16 #define SIN$K_LENGTH 16 typedef struct _SOCKADDRIN { unsigned short int SIN$W_FAMILY; /* address family */ unsigned short int SIN$W_PORT; /* 2 bytes specifying a port */ unsigned int SIN$L_ADDR; /* 4 bytes specifying an IP address */ char SIN$T_ZERO [8]; /* 8 bytes */ } SOCKADDRIN; #define SIN44$C_LENGTH 16 #define SIN44$K_LENGTH 16 typedef struct _SOCKADDRIN44 { unsigned char SIN44$B_LEN; unsigned char SIN44$B_FAMILY; unsigned short int SIN44$W_PORT; /* 2 bytes specifying a port */ unsigned int SIN44$L_ADDR; /* 4 bytes specifying an IP address */ unsigned short int SIN44$W_PORT; /* 2 bytes specifying a port */ unsigned int SIN44$L_ADDR; /* 4 bytes specifying an IP address */ char SIN44$T_ZERO [8]; /* 8 bytes */ } SOCKADDRIN44; #define SIN6$K_LENGTH 28 /* Structure size */ #define SIN6$C_LENGTH 28 /* Structure size */ typedef struct _SOCKADDRIN6 { unsigned char SIN6$B_LEN; /* length of this struct */ unsigned char SIN6$B_FAMILY; /* AF_INET6 */ unsigned short int SIN6$W_PORT; /* Transport layer port # */ unsigned int SIN6$L_FLOWLABEL; /* IPv6 flow information */ union { char SIN6$T_ADDR [16]; unsigned char SIN6$B_SA6_ADDR [16]; unsigned short int SIN6$W_SA6_WADDR [8]; unsigned int SIN6$L_SA6_LADDR [4]; unsigned int SIN6$Q_SA6_QADDR [2] [2]; } SIN6$R_ADDR_OVERLAY; unsigned int SIN6$L_SCOPE_ID; /* set of interfaces for a scope */ } SOCKADDRIN6; Perhaps I've missed where this is discussed in the manual but, how do I know which SIN (SIN, SIN44, SIN6) will be returned? Is there some call I need to make to define which I want? I'm getting back the SIN6 structure but I need to know if should it not return this on some customer's machine. There isn't a type code. Checking the first byte (SIN44$B_LEN) to see if it is greater than AF_INET=2 seems to be an option. A bit of a hack from my POV. -- VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM "Well my son, life is like a beanstalk, isn't it?" ------------------------------ Date: Tue, 15 May 2007 17:24:54 GMT From: VAXman- @SendSpamHere.ORG Subject: Re: TCPIP programming (sockaddr_in question) Message-ID: <00A67A7C.E34FD775@SendSpamHere.ORG> In article <00A67A68.F7818E9B@SendSpamHere.ORG>, VAXman- @SendSpamHere.ORG writes: >{...snip...} A little more info... the socket name structures are documented on section 5.5 of the HP TCPIP Services "Sockets API and System Services Programming"; particularly in figures 5.8, 5.9 and 5.10. When using the IO$_SENSEMODE, is there anyway to enforce one format over another? -- VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)COM "Well my son, life is like a beanstalk, isn't it?" ------------------------------ Date: 15 May 2007 00:56:53 -0700 From: stuie_norris@yahoo.com.au Subject: TCPIP programming questions Message-ID: <1179215812.960067.194250@k79g2000hse.googlegroups.com> Hi Group, I am learning to use the QIO interface to TCPIP. I has a OpenVMS Server application and several Windows XP clients (C# Sharp). On the XP Clients if I close the application by the read cross ( top right corner) - I get a ------------------------------ Date: 15 May 2007 01:55:14 -0700 From: stuie_norris@yahoo.com.au Subject: Re: TCPIP programming questions Message-ID: <1179219314.804144.49040@k79g2000hse.googlegroups.com> Hi Group, I am learning to use the QIO interface to TCPIP. I has a OpenVMS Server application and several Windows XP clients (C# Sharp). On the XP Clients if I close the application by the read cross ( top right corner) - I get a SS$_CONNECFAIL as the IOSB status word in the readvblk completion AST. If I look in the TCP programming manual I do not see SS$_CONNECFAIL as a condition value. Should I see this error code? If I close the application via a socket shutdown programmatically on the client I get the IOSB status code of SS$_LINKDISCON. What is the difference between SS$_LINKDISCON and SS$_CONNECFAIL? Thanks Stuart (Hope my question displays okay 2nd time around) ------------------------------ Date: 15 May 2007 07:08:01 -0500 From: briggs@encompasserve.org Subject: Re: TCPIP programming questions Message-ID: In article <1179219314.804144.49040@k79g2000hse.googlegroups.com>, stuie_norris@yahoo.com.au writes: > Hi Group, > > I am learning to use the QIO interface to TCPIP. > > I has a OpenVMS Server application and several Windows XP clients (C# > Sharp). > > On the XP Clients if I close the application by the read cross ( top > right corner) - I get a SS$_CONNECFAIL as the IOSB status word in the > readvblk completion AST. If I look in the TCP programming manual I do > not see SS$_CONNECFAIL as a condition value. > > Should I see this error code? > > If I close the application via a socket shutdown programmatically on > the client I get the IOSB status code of SS$_LINKDISCON. > > What is the difference between SS$_LINKDISCON and SS$_CONNECFAIL? At a guess, I'd expect that SS$_CONNECFAIL is returned when a TCP RST is received. Windows tends to produce RSTs when the app owning a particular TCP connection has been shut down hard. By contrast, I'd expect SS$_LINKDISCON to be returned when when a TCP FIN is received. This would be the case when the client app is closing down cleanly. According to a quick web search: SS$_CONNECFAIL is equivalent to ECONNRESET, "Connection reset by peer" SS$_LINKDISCON is equivalent to EPIPE, "Broken pipe" ------------------------------ End of INFO-VAX 2007.266 ************************