File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes again: check a TCP port's state Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "again: check a TCP port Watch "again: check a TCP port New topic
Author

again: check a TCP port's state

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
i was a bit too fast when i thought that i got it:
how can i check whether or not a tcp port is currently in use or not ? i found java.net.SocketPermission, but is it the right class and if it is, how do i use it ?
Jim Bertorelli
Ranch Hand

Joined: Nov 28, 2001
Posts: 136
Try opening a socket on that port and if you get an exception, the port is in use
 
 
subject: again: check a TCP port's state
 
Threads others viewed
[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing
Scaling a TCP/IP based system and ensuring high availability
client server comunication using http
Confused ,need some help in coding
Test failed: The connection to the host localhost, named instance moeincom has failed
IntelliJ Java IDE