Changeset 140
- Timestamp:
- 05/25/06 11:12:54 (2 years ago)
- Files:
-
- experiments/machine/lib/machine/eio.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
experiments/machine/lib/machine/eio.rb
r139 r140 74 74 75 75 log.debug "Pushed EventableIO (#{@@io_objects.size})" 76 77 # Give the user a chance to initialize some stuff BEFORE 78 # sending the initialization event. We DEFINE that behavior 79 # so people can depend on it. 80 # A handler for :bind can be added in the initialize block, 81 # but in single-threaded programs it can probably also be added 82 # after this initialize method completes. 83 yield self if block_given? 84 send_event( Event.new( :bind )) 76 85 end 77 86 78 87 def schedule_close 88 send_event( Event.new( :unbind )) 79 89 @close_scheduled = true 80 90 end … … 138 148 end 139 149 rescue Errno::EAGAIN 140 p "EAGAIN"141 150 rescue EOFError, Errno::ECONNRESET 142 151 schedule_close 143 send_event( Event.new( :unbind ))144 152 end 145 p "Done reading"146 153 end 147 154