🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pb.unix
Article #1

Re: PART DEUX: Problems writing a port responder under HP-UX 9 (inetd responder)

#1
From: Andrew Gierth
Date: Thu, 29 May 1997 00:00
29 lines
2031 bytes
>>>>> "Don" == Don Perkins <donperk@ix.netcom.com> writes:

 Don> BTW: Anyone else trying this will need to '#include <sys/unistd.h>' in
 Don> order to get the definition of STDIN_FILENO.

Should be #include <unistd.h> - I don't think sys/unistd.h is guaranteed
to exist.

 >> That's oversimplifying. getchar() will work, returning EOF when the
 >> socket is closed or encounters an error. There are some problems
 >> with using stdio on sockets, mainly related to signal handling, but
 >> it is still sometimes a useful technique.

 Don> In reference to using stdio with sockets:  My application will be
 Don> receiving a fixed length data record (a transaction request) and,
 Don> after some processing, return an updated version of the same record
 Don> back before closing the socket.  

If you do this with read() directly, you'll need to write your own loop
around the read (see the socket-FAQ examples) to cope with the possibility
of getting less data back from the read call than you asked for.

-- 
Andrew.

comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>

Technical Details
Message-ID: <87oh9vt4vf.fsf@erlenstar.demon.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.programmer.mbox.zip!not-for-mail
References: <338f60f6.88976683@gw.pacbell.com> <87g1v7uosb.fsf@erlenstar.demon.co.uk> <339073df.93818782@gw.pacbell.com>

Show Full Headers
Complete Article Headers
Message-ID: <87oh9vt4vf.fsf@erlenstar.demon.co.uk>
Subject: Re: PART DEUX: Problems writing a port responder under HP-UX 9 (inetd responder)
Date: Thu, 29 May 1997 00:00:00 +0000
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
References: <338f60f6.88976683@gw.pacbell.com> <87g1v7uosb.fsf@erlenstar.demon.co.uk> <339073df.93818782@gw.pacbell.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.unix.programmer.mbox.zip!not-for-mail
X-Deja-AN: 244621332
X-NNTP-Posting-Host: erlenstar.demon.co.uk [194.222.144.22]
X-Mayan-Date: Long count = 12.19.4.3.13; tzolkin = 11 Ben; haab = 11 Zip
Organization: disorganised
X-Attribution: AG
Newsgroups: comp.unix.programmer,comp.unix.questions,pb.unix,pb.unix.hp