CS 441 - Socket Examples
The following are some simple socket examples.
- This client/server pair runs a simple socket program
as an Echo Server
that only allows one client to connect to the server.
- This client/server pair improves on the previous Echo
Server that allows multiple clients to connect to the server.
- This server improves on the previous Echo Server since it
allows the "connection thread" of the server to stop executing
via a command sent from the client.
- This server improves on the previous Echo Server since it
uses a time out on the server's connection socket to continuously
check if it should stop the "connection thread" of the server
from executing.
- This server shows how the servers read thread can be interrupted
using a time out on the servers communication socket. No real
functionality has been added other than showing it can be done.
- This version of the client allows the user to enter a machine
name or IP address on the command line. The client will connect
to the server on that machine. If nothing is given on the command
line, it will connect to the a server on the same machine.
- This example shows how to send an object across a socket
by serializing a class.
- This example is not a socket example. It shows how to get the
machine name and IP address of the local machine. There is also
some more examples at
http://www.rgagnon.com/javadetails/java-0390.html.
- This example is not a socket example. It shows a simple
Read/Write lock class. THis has not been fully tested.
- This example is not a socket example. It shows a simple
Read/Write lock class. THis was create to show the synchronized
methods work as desired.
These examples were written very quickly and currently
are under commented.