Hi, In my application ,i am using udp sockets. The problem arise,when there is late reply,or no reply from the udp server,due to which timed out exception comes,as effect of this, my gui application gets hang,as i have used JOptionPane.showmessageDialog(null,"As the response of udp server"), to show response.
If you must have a response, UDP is the wrong protocol to use:
UDP does not guarantee reliability or ordering in the way that TCP does. Datagrams may arrive out of order, appear duplicated, or go missing without notice. Avoiding the overhead of checking whether every packet actually arrived makes UDP faster and more efficient, for applications that do not need guaranteed delivery. Time-sensitive applications often use UDP because dropped packets are preferable to delayed packets.