The SSLServer Class

The SSLServer class creates a socket server and then listens for connections from clients. This class behaves much as a standard socket server implementation would in relation to the socket connection. It listens for a connection, and when a connection is received, it spawns a new thread to manage the connection. The thread started is an instance of the OrderRequestProcessor class, as shown previously. This class manages the details of the communication protocol and uses an instance of the OrderProcessing class to process the request.

A single instance member is declared for an SSLServerSocketFactory reference. As we will see shortly, the constructor performs the task of creating this reference.

Within the main program block, ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.