[jboss-user] [Remoting] - Can a TransporterServer generate port?

gcollis do-not-reply at jboss.com
Mon Feb 25 02:09:51 EST 2008


I want to randomly generate ports using TransporterServer. Currently I can wrap POJO's and beam them with a server with a known port number.

To get around this I am currently storing the last port used and incrementing by one, then creating a Locator, then passing it to one of the TransporterServer.create??? methods. The issue is that sooner or later I will clash on an already in use port.

OK, I can catch the exception and loop but is there a better way.

If I try and use a PORT of 0 for the port in the locator string, when passed to the a TranporterServer.create??? this should produce a server on a random port. Unfortunately I cannot find a way get the actual PORT it used and therefore cannot create a locator for the client.

Note the POJO's carry state so I need a server for each client.

Any suggestions welcome, thanks, Graeme

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131735#4131735

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131735



More information about the jboss-user mailing list