Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I check if a socket port is avaible?  RSS feed

 
ying lam
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can you please tell me how can I check if a point is available to open in Java?
i.e. no one else has opened it?

Thank you.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply try to open it - if it is open by another application already, an exception will be thrown.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!