From: "Ben Gelb" <ben@gelbnet.com>
To: tpm@prkele.tky.hut.fi
Cc: linux-hams@vger.kernel.org
Subject: RE: ax25d and STDIN
Date: Sun, 29 Sep 2002 18:14:39 -0400 [thread overview]
Message-ID: <000f01c26805$9daf6d00$0bc43e2c@ben> (raw)
In-Reply-To: <Pine.LNX.4.44.0209292103580.13963-100000@oh2bns.ampr.org>
I think I am going to stick with my hack. It works fine for the amount
of data I will be inputting at a time (less than 80 chars) so I don't
forsee any problems.
There is no real way to do a low-level read() in php, not that I am
aware of anyway, and the setbuf() family of functions doesn't exist.
Thanks for your help, perhaps I'll consider using C next time, but I
really want an uncompiled language so I can make changes quickly if
problems arise. I think I mentioned that before.
73 Ben
-----Original Message-----
From: linux-hams-owner@vger.kernel.org
[mailto:linux-hams-owner@vger.kernel.org] On Behalf Of Tomi Manninen
Sent: Sunday, September 29, 2002 2:27 PM
To: Ben Gelb
Cc: linux-hams@vger.kernel.org
Subject: Re: ax25d and STDIN
On 28 Sep 2002, Ben Gelb wrote:
> Using fread with a large length doesn't work, because EOF is never
found
> in stdin. So it just keeps waiting for the number of bytes specified.
Actually I Don't think it's EOF that is missed. You would expect to see
EOF only when the user disconnects. It's probably that the io stream is
fully buffered. Playing with the setbuf() family of functions (if
available in php, perl or whatever you use, I don't know) might be a
solution.
> I don't really understand why this works with the SEQPACKET
> consideration. I am definitely not getting the whole packet at once,
> yet, as I said, it does work.
Your code (which I believe in some form uses the libc stdio library)
buffers the reads and the actual low level read() is called with a
buffer
larger than what you specify. The default is probably the machine page
size. I think that's why it works.
I have found that the safest option is to directly use a low level
read()
call and handle any buffering my self. I don't know if that is an option
for you however. So after all your hack might the best solution.
--
Tomi Manninen Internet: oh2bns@sral.fi
OH2BNS AX.25: oh2bns@oh2rbi.fin.eu
KP20ME04 Amprnet: oh2bns@oh2rbi.ampr.org
-
To unsubscribe from this list: send the line "unsubscribe linux-hams" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2002-09-29 22:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-27 5:08 ax25d and STDIN Ben Gelb
2002-09-27 7:52 ` Tomi Manninen OH2BNS
2002-09-27 11:34 ` Ben Gelb
2002-09-27 23:09 ` Tomi Manninen
2002-09-28 5:19 ` Ben Gelb
2002-09-29 18:26 ` Tomi Manninen
2002-09-29 22:14 ` Ben Gelb [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000f01c26805$9daf6d00$0bc43e2c@ben' \
--to=ben@gelbnet.com \
--cc=linux-hams@vger.kernel.org \
--cc=tpm@prkele.tky.hut.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.