What happens if the buffer of a socket is full?

What happens if the buffer of a socket is full?

Post by Joachim Plaettner-Hochwart » Tue, 02 Feb 1999 04:00:00



Hi,
I'm using a socket connection in one of my programs to send every second
a set of data to another application - for each set I use a separate
write(). Now it happens that if there are too many data set, the program
quits without notifying anything! Could the reason be that the socket
buffer is full, and if so, why doesn't the write() or read() return an
errno value? Is there a way to check if the buffer is full?

Thanks for any help...

Joachim

-----------------------------------------------------------------------

-----------------------------------------------------------------------

 
 
 

What happens if the buffer of a socket is full?

Post by Andrew Giert » Tue, 02 Feb 1999 04:00:00


 Joachim> Hi,
 Joachim> I'm using a socket connection in one of my programs to send
 Joachim> every second a set of data to another application - for each
 Joachim> set I use a separate write(). Now it happens that if there
 Joachim> are too many data set, the program quits without notifying
 Joachim> anything!

Are you ignoring SIGPIPE (you should)?

If you write() to a socket that has been closed on the other end
(or the other end has died for some reason, or gone away) then your
program will receive a SIGPIPE signal, which kills it if not blocked,
ignored or caught. (Ignoring it is the best method, in which case the
write() call returns EPIPE instead.)

--
Andrew.

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

 
 
 

1. Line buffer and Full buffer

hi.
Could anyone tell me what is the difference between Line buffer and full
buffer?

thanx in advance.

wei

************************************************************
Wei Weng                       &    A   N   NIIIM   MEEEE  *
Box s-1398                     &   A A  NN  N I MM MM      *
Stevens Institute of Technology&  A   A N N N I M M MEEEE  *
Hoboken, NJ 07030              & AAAAAAAN  NN I M   M      *

************************************************************

2. Plattform for Linux

3. A simple link,write buffer is full and read buffer is empty.

4. which better: forking or multithreading?

5. What happened to IFS?

6. Sun Fire Midframe Server Configuration Best Practices

7. Whats happens when the disk is full?

8. HELP - How to install linux via NFS?

9. What will happen if the volume full to the clonefileset on AdvFS

10. What will happen when disk(ext3) is full while i continue to operate files ?

11. 2.4 and full ipv6 - will it happen?

12. Am I running out of STREAMS buffers?

13. I am looking for a full-time junior unix position