File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes DatagramSocket.receive(DatagramPacket) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "DatagramSocket.receive(DatagramPacket)" Watch "DatagramSocket.receive(DatagramPacket)" New topic


sai challa
Ranch Hand

Joined: Feb 06, 2001
Posts: 54
If a java client does a timed wait for a UDP msg from the server, by blocking on DatagramSocket.receive(DatagramPacket) and if it times out on couple of tries, then the socket figures out that the Server is down and sets its state such
that the next call to receive() will not block but would rather
straight away give IOException.

After a while if the Server is up, even then the socket is not able to receive any data. This wasn't the case with older JVMs. In older netscape, the Java client(an applet) will be able to resume receiving packets.
Could anybody help me by answering if there is a way to reinitialize the socket that has given up on the server, to start receiving data when the server is up?
[This message has been edited by sai challa (edited June 07, 2001).]
I agree. Here's the link:
subject: DatagramSocket.receive(DatagramPacket)
jQuery in Action, 3rd edition