Projects

Ticket #565 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

GCD sources should return passed-in handle for handle method

Reported by: jkh@… Owned by: ernest.prabhakar@…
Priority: blocker Milestone: MacRuby 0.6
Component: MacRuby Keywords:
Cc:

Description

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.

Change History

Changed 2 years ago by ernest.prabhakar@…

  • status changed from new to closed
  • resolution set to fixed

Fixed in r3320

Changed to allow (and return) anything that can respond to "to_i" as a handle, for maximum flexibility.

Note: See TracTickets for help on using tickets.