Drb Client running on windows opens multiple sockets and the puts them in a
time wait
-------------------------------------------------------------------------------------
Key: JRUBY-2508
URL: http://jira.codehaus.org/browse/JRUBY-2508
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Environment: Windows XP, Jruby 1.1.0
Reporter: Derek Townsend
Priority: Critical
When a Drb client runs on windows it create multiple sockets and then
immediately closes them. It is only the client code that does this.
When the same code was run under MRI ruby it worked fine.
# ==== Client code
#
require 'drb/drb'
# The URI to connect to
SERVER_URI="druby://localhost:8787"
# Start a local DRbServer to handle callbacks.
#
# Not necessary for this small example, but will be required
# as soon as we pass a non-marshallable object as an argument
# to a dRuby call.
DRb.start_service
timeserver = DRbObject.new_with_uri(SERVER_URI)
100.times do
sleep(1)
puts timeserver.get_current_time
end
# This illustrates setting up a simple client-server drb
# system. Run the server and client code in different terminals,
# starting the server code first.
#
# ==== Server code
#
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
This problem only occurs on windows and only with JRUBY running the client.
Since Drb uses Sockets , it a socket problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email