I am working on
Java Desktop application with client server architecture.
The prob. is , suppose there are two machines, on both my swing desktop application is running. And on one ServerSocket is running ,and on other
clientSocket is running.
And in my application ServerSocket only closes when there is proper logout(means in my gui i have logout button) on clicking logut button,
ServerSocket (object) gets close.So that, when we login next time ,
port should be available for ServerSocket to listen.
On the other machine i.e client , on particular events packets are send to ServerSocket.where serversocket listen to request and do the job.
But the problem is that suppose improper logout occur at serversocket end,
the port for serverSocket does not get releases ,meanwhile if clientSocket
send request to serverSocket ,connection refused exception is thrown.
Since jvm keeps serverSocket running on server machine .
So any body can suggest how to close the serverSocket automatically.
a prompt reply is awaited.
Sachindra