Re: tcp connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 25, 2004 at 09:51:32AM +0530, Dinil Divakaran wrote:
> I a new into this area. So please excuse me, if my doubt
> is too simple.
> I am trying to measure the available bandwidth of a 35 Kbps
> ppp connection. I wrote a 2 programs, which when run at the two
> ends, establishes a tcp connection. The client sends some junk
> and the server simply receives it. The client after connecting
> to the server, prints the time and starts sending data. When
> it has sent N (say 30 KB) of data it stops and prints time.
> But even at this time the server doesn't stop. When I do a
> tcpdump, I find the server is still sending acknowledgements.
> My doubt is, this being a tcp connection, how can the client
> exit before receiving the acknowledgements.

Your program never gave any notice to the kernel that it was interested
in the response from the other end. You just closed the socket and
quit. The kernel needs the acks to guarentee the data reached the other
end, but it doesn't need your program around to do it. If you want to
wait till the other end exits, read the socket which will return when
the far end has closed the connection.

Be careful of the situation where each end is waiting for the other.

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgpnytm7KB5Xo.pgp
Description: PGP signature


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux