Binding to a port

I am reading the documentation and it says the ServerSocket(12345) would bind to 12345 port. So does this mean any other application won't be able to use this port?

I am trying to build a class which can hold on to a port and when required release it. The reason is that some other application on the same server will not be able to use that port.

Let me know if creating using serversocket is the way to go or there is another way explicit hold can be placed on a port.

Thx

[500 byte] By [ray6855a] at [2007-11-26 19:37:15]
# 1

:)

ServerSocket s1, s2;

s1 = new ServerSocket( 12345 );

s2 = new ServerSocket( );

s2.setReuseAddress( true );

s2.bind( new InetSocketAddress( 12345 ) );

Michael.Nazarov@sun.coma at 2007-7-9 22:14:08 > top of Java-index,Archived Forums,Socket Programming...