🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
3 messages
3 total messages Started by Steven T. Abell Mon, 03 Aug 1992 18:18
Timeouts when reading from a serial port
#424
Author: Steven T. Abell
Date: Mon, 03 Aug 1992 18:18
9 lines
797 bytes
The read function blocks until it has read enough stuff from the port.
But if there is nothing out there to respond, the application hangs.
Very annoying. I've dealt with this kind of thing a zillion times on
embedded realtime systems, but I don't know how to approach it in this
programming environment. Is there a preferred way of solving this problem?

Thanks,

Steve abell@netcom.com
Re: Timeouts when reading from a serial port
#430
Author: Sean T. Lamont
Date: Tue, 04 Aug 1992 05:36
12 lines
1116 bytes
In article <71tmbc#.abell@netcom.com> abell@netcom.com (Steven T. Abell) writes:
>The read function blocks until it has read enough stuff from the port.
>But if there is nothing out there to respond, the application hangs.

Look at select();


-- 
Sean T. Lamont, Abstract Software        |   "Don't oppress me, It's
zeno@u.washington.edu                    |    'computer of color!' "
Next Mail............................... |  yang.cpac.washington.edu!zebu!zeno 
----------------"My employers opinions are my own, not yours."-----------------
Re: Timeouts when reading from a serial port
#451
Author: moose
Date: Tue, 04 Aug 1992 16:30
19 lines
1221 bytes
In article <71tmbc#.abell@netcom.com> abell@netcom.com (Steven T. Abell)  
writes:
> The read function blocks until it has read enough stuff from the port.
> But if there is nothing out there to respond, the application hangs.
> Very annoying. I've dealt with this kind of thing a zillion times on
> embedded realtime systems, but I don't know how to approach it in this
> programming environment. Is there a preferred way of solving this problem?
> 

There is an ioctl called FIONBIO which will handle this problem for you.  The  
only documentation is in the header file /usr/include/sys/ioctl.h, but this one  
is pretty straight forward.

 
--
Michael Rutman			|	moose@svcdudes.com
Cubist				|	makes me a NeXT programmer
Software Ventures		|	maker of MicroPhone II
#include <std.disclaimer>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads