Serialization using Sockets

Running the Example

Complete the following procedure to compile and run the two examples:

  1. From yourbasedir/objectserializationexamples/UsingSockets, compile the files Server.java and Client.java using JDK1.1 or higher:

    javac Server.java
    javac Client.java

  2. Run the Server:

    java Server

  3. Suspend the Server, using Control/Z in UNIX.

  4. Put the Server in the background. On UNIX:

    bg

  5. Run the Client:

    java Client

The current date is sent from the client using sockets and serialization to the server, which then prints out the date.



For more information: