Question: how socket works?

pantz at brain.mth.msu.edu pantz at brain.mth.msu.edu
Tue Jul 11 13:12:23 AEST 1989


I tried to use socket (STREAM) to transfer data between two machines as
follows:
   	 Machine A	Machine B
	  data_1 ------>
	  data_2 ------>
	  .....
	  data_n ------>
		 <------ ACK
	  close		 close

The problem is that Machine B can only receive first several packets and the
last one most of time.  However, if I have Machine A to sleep for a
second after it sends out a packet, Machine B can then receive all the
packets.  It will also work O.K. if Machine B ACK Machine A whenever
Machine B receive a packet.
I was expecting that the socket of sender should have a queue to keep
all outstanding data, but it doesn't seem to work that way.
Can anyone explain this result?  Is this reasonable?  Thanks.



More information about the Comp.unix.wizards mailing list