[jboss-jira] [JBoss JIRA] Closed: (JBREM-289) PortUtil only checking for free ports on localhost
David Lloyd (JIRA)
jira-events at lists.jboss.org
Wed Sep 26 05:31:17 EDT 2007
[ http://jira.jboss.com/jira/browse/JBREM-289?page=all ]
David Lloyd closed JBREM-289.
-----------------------------
> PortUtil only checking for free ports on localhost
> --------------------------------------------------
>
> Key: JBREM-289
> URL: http://jira.jboss.com/jira/browse/JBREM-289
> Project: JBoss Remoting
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: general
> Affects Versions: 1.4.0 beta
> Reporter: Tom Elrod
> Assigned To: Tom Elrod
> Fix For: 1.4.0 final
>
>
> The PortUtil class has the following method:
> public static boolean checkPort(int p)
> {
> boolean available = true;
> ServerSocket socket = null;
> try
> {
> socket = new ServerSocket(p);
> }
> catch(IOException e)
> {
> log.debug("port " + p + " already in use. Will try another.");
> available = false;
> }
> finally
> {
> if(socket != null)
> {
> try
> {
> socket.close();
> }
> catch(IOException e)
> {
> }
> }
> }
> return available;
> }
> problem is that just using ServerSocket(p) creates the socket on the localhost and can not specify particular bind address.
> Also, the way is coded now, will continue to loop forever looking for a port.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list