December 2002
Intermediate to advanced
1050 pages
24h 49m
English
The best way to learn the Java network API is through a demonstration. In the following example, a SocketServer instance listens for a connection, and when a connection is detected, it starts a thread to manage the connection. This is a fairly efficient method for handling connections, since incoming connection requests do not need to wait while prior connections are handled—all are, theoretically, handled at the same time.
In practice, the spawning of threads would not be open-ended and would be limited in some way to avoid overloading the system with processing. In this example, for brevity, we do not show that code.
The server application represents a server for order processing. As requests ...
Read now
Unlock full access