Asynch sockets -> how?

Asynch sockets -> how?

Post by Eugene Grayv » Tue, 17 Sep 1996 04:00:00



Hi,

This may be trivial, but I was not able to find an answer in any faq...
I want to use the standard unix sockets in an asynchronous way.  I.e. I want
a send/recv command to return immediately.  I am sure there is a way to
specify a non-blocking socket, but I can not find it.

Thanks
Eugene

 
 
 

Asynch sockets -> how?

Post by Andrew Gier » Tue, 17 Sep 1996 04:00:00


 Eugene> Hi, This may be trivial, but I was not able to find an answer
 Eugene> in any faq...  I want to use the standard unix sockets in an
 Eugene> asynchronous way.  I.e. I want a send/recv command to return
 Eugene> immediately.  I am sure there is a way to specify a
 Eugene> non-blocking socket, but I can not find it.

Careful; "asynchronous" and "non-blocking" are different terms; you need
to be sure which one you want.

If a socket is in non-blocking mode, then send() & recv() calls will not
block. Non-blocking mode is set by doing:

  int flags = fcntl(fd, F_GETFL, 0);
  fcntl(fd, F_SETFL, flags | O_NONBLOCK);

or

  int i = 1;
  ioctl(fd, FIONBIO, &i);

If a socket is in asynchronous mode, then SIGIO will be sent to the owning
process (or process group) when data is available. This is more complex to
handle, and much less portable.

Non-blocking mode + select() is usually much cleaner than asynchronous mode.

--

"Ceterum censeo Microsoftam delendam esse" - Alain Knaff in nanam

 
 
 

Asynch sockets -> how?

Post by Jo Mede » Wed, 18 Sep 1996 04:00:00



> This may be trivial, but I was not able to find an answer in any faq...
> I want to use the standard unix sockets in an asynchronous way.  I.e. I want
> a send/recv command to return immediately.  I am sure there is a way to
> specify a non-blocking socket, but I can not find it.

man fcntl
man setsockopt
man select
lynx http://www.auroraonline.com/sock-faq/

Cheers,
        Jo

--

 
 
 

Asynch sockets -> how?

Post by hil.. » Thu, 19 Sep 1996 04:00:00




> > This may be trivial, but I was not able to find an answer in any faq...
> > I want to use the standard unix sockets in an asynchronous way.  I.e. I want
> > a send/recv command to return immediately.  I am sure there is a way to
> > specify a non-blocking socket, but I can not find it.

> man fcntl
> man setsockopt
> man select
> lynx http://www.auroraonline.com/sock-faq/

I must be missing some man pages. Does anyone know what files fcntl and
select are in?

TIA

-- Steve

========================================

Your disclaimer here.

========================================

 
 
 

Asynch sockets -> how?

Post by Stephen Bayn » Fri, 20 Sep 1996 04:00:00


: >
: > man fcntl
: > man setsockopt
: > man select
: > lynx http://www.auroraonline.com/sock-faq/
: >

: I must be missing some man pages. Does anyone know what files fcntl and
: select are in?

You may have poll (SYS5) rather than select (BSD).
--

Philips Semiconductors Ltd
Southampton                                 My views are my own.
United Kingdom
 Are you using ISO8859-1? Do you see ? as copyright, as division and ? as 1/2?

 
 
 

Asynch sockets -> how?

Post by hil.. » Fri, 20 Sep 1996 04:00:00





> : >
> : > man fcntl
> : > man setsockopt
> : > man select
> : > lynx http://www.auroraonline.com/sock-faq/
> : >

> : I must be missing some man pages. Does anyone know what files fcntl and
> : select are in?

> You may have poll (SYS5) rather than select (BSD).
> --

No man page for poll either. Damn!

Guess I'll go to Borders over lunch.

-- Steve

========================================

The opinions and policies of my
employer do not necessarily
represent my own.

========================================

 
 
 

1. Asynch > TCP/IP > Asynch - How to?

Can somebody help me find a device that will take a straight asynchronous bit
stream and put it on a TCP/IP connection.  I would envision it to be a box
something like a terminal server, that would just take the stream and
packetize it over an permanently established TCP/IP connection.  The box would
have a configurable IP address for both source and destination so that it
would only need to establish TCP port numbers and accept the asynch data at
the application layer.

Anybody seen anything or have any ideas?

2. How to know what changed in RPM package?

3. Asynch socket I/O in Solaris 2.4?

4. At last I have found a TIN man!

5. Asynch socket IO

6. X11R5 apps take forever to start up ...

7. Question about sockets (asynch)

8. Unable to format in 1 K - blocks

9. >>> unclosed socket <<<

10. <><><> MOUNTING EXTENDED PARTITION <><><>

11. Wanted: <><><> Unix Specialist <><><>

12. LILO help <><><><><><>

13. >>---> Software Jobs! >>--->