Sockets
This is the code and examples for the Sockets chapter.
The following classes are part of the javageeks.com library, and are available there,
instead of in this directory:
The following code and examples are in this directory:
-
Client.java: A socket client, with which we will test the various
Sockets examples. The Client class comes in two forms: one which uses the
ThreadedPipeStream class from
the javageeks.com library, and the other, which uses locally-written Thread classes to do the
same thing. ThreadedPipeStream was written to replace what Client originally was listed as
doing, as described in the text.
-
EchoService.java: A simple GJAS service to listen on a socket,
and echo back any input received from the socket.
-
TimeService.java: A simple GJAS service to listen on a socket,
and send back the current date/time (in human-readable format) when a connection is made.
-
Echo2Service.java: The EchoService, rewritten to use the
com.javageeks.gjas.services.SocketServer class as a base class.
-
EchoConnection.java: The EchoService, rewritten to use the
com.javageeks.gjas.services.ConnectionManager and com.javageeks.gjas.connection.Connection API