[MacRuby-devel] [MacRuby] #565: GCD sources should return passed-in handle for handle method
MacRuby
ruby-noreply at macosforge.org
Wed Jan 20 12:08:21 PST 2010
#565: GCD sources should return passed-in handle for handle method
---------------------------+------------------------------------------------
Reporter: jkh@… | Owner: ernest.prabhakar@…
Type: defect | Status: new
Priority: blocker | Milestone: MacRuby 0.6
Component: MacRuby | Keywords:
---------------------------+------------------------------------------------
In this small example of a socket source:
s = TCPServer.open(hostname, port)
src = Dispatch::Source.new(Dispatch::Source::READ, s, 0, q) { |src|
sock = src.handle
sock.accept
}
You don't actually get the original handle back and therefore cannot call
the accept function on it. Sources should encapsulate the original handle
so that you can safely get it inside the handler block.
--
Ticket URL: <http://www.macruby.org/trac/ticket/565>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list