0

Possible Duplicate:
How do I close a port in a case of program termination?

I am running my program on a linux machine with no user interface. It's written in Java. I have a ServerSocket listening at a certain port. A client socket will send an exit command to the server, and then the program stops. But after tje client sends the exit message, the server port does not seem to close. When I try to start my program again I get a java.net.BindException: Address already in use.

How can I close this port now? Can someone please recommend some linux commands or tools to monitor the port status?

Thank you.

Community
  • 1
  • 1
lucky_start_izumi
  • 2,265
  • 13
  • 39
  • 59

0 Answers0