Posted By:
Jaise_George
Posted On:
Wednesday, July 16, 2003 02:52 AM
Hi, Suppose I am creating a ServerSocket on port number 9000. The ServerSocket.accept() waits until a request is received and it returns a Socket instance. In the following code... ...... sServer = new ServerSocket("....", 9000); Socket sChild = null; while(true) { sChild = sServer.accept(); ProcessRequest( sChild ); } ...... my question is, if ProcessRequest() takes a long time for processing, will the ServerSocket accepts further requests from other clients?? If it blocks, what is the better way to make it available for further requests. Also I would like to know whether sChild also uses 9000 fo
More>>
Hi,
Suppose I am creating a ServerSocket on port number 9000. The ServerSocket.accept() waits until a request is received and it returns a Socket instance. In the following code...
......
sServer = new ServerSocket("....", 9000);
Socket sChild = null;
while(true) {
sChild = sServer.accept();
ProcessRequest( sChild );
}
......
my question is, if ProcessRequest() takes a long time for processing, will the ServerSocket accepts further requests from other clients??
If it blocks, what is the better way to make it available for further requests.
Also I would like to know whether sChild also uses 9000 for its communication, or its uses another randon Port address for the communication thereby freeing up 9000.
Thanks in advance.
Jaise George
<<Less