Write two programs (or one program with two modes) which run on networked computers, and send some messages between them.

The protocol used may be language-specific or not, and should be suitable for general distributed programming; that is, the protocol should be generic (not designed just for the particular example application), readily capable of handling the independent communications of many different components of a single application, and the transferring of arbitrary data structures natural for the language.

This task is intended to demonstrate high-level communication facilities beyond just creating sockets.

require 'drb/drb'
 
# The URI for the server to connect to
URI="druby://localhost:8787"
 
class TimeServer
 
  def get_current_time
    return Time.now
  end
 
end
 
# The object that handles requests on the server
FRONT_OBJECT = TimeServer.new
 
$SAFE = 1   # disable eval() and friends
 
DRb.start_service(URI, FRONT_OBJECT)
# Wait for the drb server thread to finish before exiting.
DRb.thread.join