The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
August 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


RE: ServerSocket Freezing !

Posted by Wil on August 26, 2001 at 8:00 PM

> ServerSocket serverSocket = new ServerSocket(port);
> serverSocket.accept();

When the program runs into serverSocket.accept(), it will stay there until a connection is made.

> my program just freezes!! I heard this happens when u try make multiple connections to the same port but im sure this port is not open already on my system and nothing else is trying to connect to it. Please help !

If the port is already opened, I believe it throws an Exception.
If nothing its connection to it, then you need to make something connection to it so that the programming will continue on.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us