Socket question

J Bradfield ecsv24 at castle.ed.ac.uk
Sat Oct 28 03:10:01 AEST 1989


I have a problem understanding the behaviour of sockets, though the
answer may involve the stdio library instead.
On Suns or Pyramids, consider the following sequence of events:
Server Process                   Client Process
listen's on a TCP port            
accept's                         connect's to server
fdopen's socket & setbuf's to    fdopen's socket
 unbuffered
receives data (fscanf etc) and   sends data (fprintf etc) and rewind's
 rewind's                         
sends data                       receives data
                                 getc's on the socket stream
                                 process receives signal and signal
                                  handler exits.
putc's one character on socket stream
 returns without error
putc's one character again
 returns error indication



Why does the server process get an error on the second putc, not the first?



More information about the Comp.unix.questions mailing list