While i am running my program i have svrSocket.accept() method..My program is automatically getting terminated when it reaches to svrSocket.accept() method. Please suggest what needs to be done.
See Question&Answers more detail:osWhile i am running my program i have svrSocket.accept() method..My program is automatically getting terminated when it reaches to svrSocket.accept() method. Please suggest what needs to be done.
See Question&Answers more detail:osHere is what you need to provide before we can really help you.
Stacktraces for exceptions that accept() might be throwing. If this is a simple console application look for those in the console of your IDE. There is a separate window that it runs in and shows output like this.
Is the program truly terminating? accept() is a blocking call and blocks forever until another process connects to it through the socket. Have you tried running a client that connects to your server socket to see if it un blocks and continues to run? If you have to click the stop button, if multiple run windows are open then your program is simply blocked on the accept() call and it's working as designed.