Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to block the port  RSS feed

 
vedavati nilange
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Urgent:
I want to communicate with 5 RMI Clients. However the communication will be done using non-standard port: 11088. I want to do one test over here. I want to block a port for one RMI Client. Could you please tell how to block port for one RMI Client.
Also could you please tell, is there any command which tells the port is already in use. (How to check whether any specific port is already in use). Please if you know
Thanks in advance.
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not too sure whether i understood your question.
What is it that "communicate with a client" means? Typically, a server does not need to know about clients. This will defeat the entire purpose of making a server!
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try to open a java.net.ServerSocket on that port. If an IOException is thrown it is probably because that port is already in use.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!