Flushing sockets

James Seidman jseidman at jarthur.Claremont.EDU
Wed Feb 14 17:22:42 AEST 1990


I'm writing some socket code, and I need to make sure that a final message
goes out before I disconnect.  If I close the socket soon after writing
the message, it often doesn't make it out.  Putting in a sleep(1) between
the write and the close fixes the problem, but since this one program
serves several sockets, I don't want to do that.  Is there an equivalent
to fflush which works on sockets?  My system has a man page for a routine
called flush, but it appears to be only for assembly language routines.
-- 
-------------------------------------------------------------------------------
Jim Seidman, Harvey Mudd College, Claremont, CA 91711.  (714) 621-8000 x2026
DISCLAIMER: I don't even know if these are opinions, let alone those of
            anyone other than me.



More information about the Comp.unix.questions mailing list