-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
sandeep wrote:
> In tcp/ip we can find socket is close by recv( ) returns zero but in
> UDP how to find socket is closed other end in client and server program
> in C
You cant.
At least, not without explicit assistance from the application code
that opened the socket. The "closer" will have to explicitly notify the
other party that it is no longer going to send datagrams. This
notification /can/ be in the form of a datagram (i.e. an "I'm done"
message), but it is not a requirement. The other party must also be
able to handle the notification that the "closer" provides. It's
simpler to just assume that the sender always closes immediately after
the datagram is sent. UDP is, after all, a connectionless protocol, and
this assumption would be consistant with the behaviour of a
connectionless protocol.
HTH
- --
Lew Pitcher
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - WinPT 0.11.12
iD8DBQFFE9SdagVFX4UWr64RAi/mAJsGJnJ47vZWK8/kELQfGXoQl1Bf+QCbB8gW
lnkSeQAUS4q2u/0OSkzOcB0=
=ykQp
-----END PGP SIGNATURE-----
|