Networking Forums

Networking Forums > Computer Networking > Linux Networking > How to find UDP socket is closed in client and server program in C

Reply
Thread Tools Display Modes

How to find UDP socket is closed in client and server program in C

 
 
sandeep
Guest
Posts: n/a

 
      09-22-2006, 11:18 AM
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

 
Reply With Quote
 
 
 
 
Lew Pitcher
Guest
Posts: n/a

 
      09-22-2006, 12:18 PM
-----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-----

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why my client-server program in not working over internet ?? asit Linux Networking 0 08-29-2007 07:11 PM
A Strange - 421 Service not available, remote server has closed connection - problem for Linux ftp client. vince Linux Networking 0 03-09-2007 09:35 PM
threading issue : SIGPIPE => SIG_IGN (writing to closed socket) Oliver Kowalke Linux Networking 0 12-30-2006 09:34 AM
Simple client/server socket program works on one Linux machine, it doesnot work on other machine GS Linux Networking 2 05-09-2006 12:55 PM
select with timeout hangs when socket is closed eran borovik Linux Networking 0 10-19-2004 03:54 PM



1 2 3 4 5 6 7 8 9 10 11