Using Serialization with Sockets

" WIDTH="610" HEIGHT="4">

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:
      javac Server.java
      javac Client.java 
    
  2. Run the Server:
      java Server
    
  3. Suspend the Server, using Ctrl/Z on Solaris, Linux, or Mac OS X systems.
  4. Put the Server in the background, using the following command on Solaris, Linux, or Mac OS X systems:
      bg
    
  5. Run the Client:
      java Client
    

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

blue bar

Additional Information:

Abstract
Sources
List of Examples

Oracle and/or its affiliates Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved.

微信小程序

微信扫一扫体验

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部