Click to See Complete Forum and Search --> : Server closing after running only once


razia5
January 30th, 2003, 12:19 PM
Hi.

In the file transfer client-server program (Socket Programming) I wrote, the server program is closing after only one transfer has been made. I want my server program to run all the time and continously accept client requests.

Can someone plz help me and tell me what to do?

Thanks

Bnt
February 3rd, 2003, 03:52 AM
Hi,

Without seeing the code I'm going to take a guess at this, you are only accepting client connections once, possibly in a constructor or so. What you could do is extend Thread or implement Runnable and in the run method continually call the ServerSocket.accept() method in a while loop, this way you server will continously listen for new client connections.

Good Luck
Byron