non-blocking sockets

non-blocking sockets

Post by Stephen Brods » Sun, 20 Jun 1993 05:03:36

(I'm running standard "c" on a Sun Sparc 2 using SunOS 4.1)

I've used sockets quite frequently in the past, but I'm now getting
stumped setting up my sockets in non-blocking mode.  The X-app I'm
writing can't block, that's why I`m forced to use non-blocking

The problem is this: after a period of time and use, the server side
socket application refuses to accept a connection and returns errno
35, EWOULDBLOCK.  As I'm seeing it, the socket system gets hosed,
not even letting me accept connections on a different socket #.
Not until I reboot (!!) the system do the sockets get freed up and
I'm ready to accept connections (until the problem inevitably pops
up again).  

Have I uncovered some mystical, magical socket bug or did I blow


1. Blocking and Non-Blocking socket


I have a socket that I use for read/write. When created, the socket is
blocking by default. I want it to be blocking sometimes and
non-blocking other times. I have succeeded in switching from Blocking
to Non-blocking using

      fcntl(socket, F_SETFL, O_NONBLOCK);

but now I want to set it back to blocking. Is there something like

      fcntl(socket, F_SETFL, O_BLOCK);

around? I cannot find a way to set it back to blocking. Thanks for any


2. 2nd RSA Challenge Solved--Biggest distributed computing event ever on the internet

3. Non-blocking socket reads block! (Bug?)

4. Do Java Servlets Have to Be Under Apache's ServerRoot?

5. Difference between blocking and non-blocking socket ?

6. Upload/DownLoad Automation

7. What is difference of SYNC, ASYNC, BLOCKING, NON-BLOCKING sockets?

8. UPS(For FreeBSD)

9. Non-blocking sockets on SunOS 4 are blocking

10. select() behavior for Blocking and non-blocking sockets.

11. How do I set a non-blocking socket back to blocking?

12. Non blocking socket blocks; says 'read would block' ?

13. Select in non-blocking sockets