|
Server Actions |
Receive connections from clients |
|
|
Socket sock; // Declare a socket to represent the connection to a
// specific client, i.e. the socket client and server will
// communicate over
// Call accept() on the ServerSocket to receive client connections,
// when a connection is received a new socket is returned over which
// the client and server will communicate
while(true) {
try {
sock = acceptSock.accept();
}
catch(IOException ioe) {
System.out.println("accept error: " + ioe.getMessage());
break;
}
/* ... Process client connection ... */
}
// Only break out of while loop if there was an error
|
| See the "Links" link above to find out the sources of the proposed informations Pascal Vuylsteker / eScience / Computer Science / ANU |
Last modified: 22/3/2005
TOC - Print |
Send your comments at : <pvk@vuylsteker.net> |