On Sat, Apr 29, 2006 at 08:09:34AM +0100, Roshan wrote:
Tried, this today again, and now it does, create a server on port 4000, but still takes around 7-8 minutes.
Umm...isn't that kinda obvious. If you start it at port 0, it will take a long time to determine a free port.
The reason, I used port 0 is because, I could get the server started on 4000 and Redhat did not make it visible to me whether it had bound some application to that port. Port 0 ultimately, gave a choice to the OS to find out port for me :)
I'm guessing that the kernel (or JVM maybe!) is trying to *find* a free port for you startting from the lower end of 65536(?) that is why it is taking so long. Why not simply try listening on port 4000 and exit if the socket creation fails or maybe try the next one until you find a free one _within_ a reasonable time limit and fail completely if not.
Nosferatu