Project

General

Profile

Bug #2339 ยป server.rb

 
1
require 'drb/drb'
2

    
3
# The URI for the server to connect to
4
URI="druby://localhost:8787"
5

    
6
class TimeServer
7

    
8
  def get_current_time
9
    return Time.now
10
  end
11

    
12
end
13

    
14
# The object that handles requests on the server
15
FRONT_OBJECT=TimeServer.new
16

    
17
$SAFE = 1   # disable eval() and friends
18

    
19
DRb.start_service(URI, FRONT_OBJECT)
20
# Wait for the drb server thread to finish before exiting.
21
DRb.thread.join