class EventMachine::EvmaUDPSocket

def eventable_write

This really belongs in DatagramObject, but there is some UDP-specific stuff.
#eventable_write
def eventable_write
  40.times {
    break if @outbound_q.empty?
    begin
      data,target = @outbound_q.first
      # This damn better be nonblocking.
      io.send data.to_s, 0, target
      @outbound_q.shift
    rescue Errno::EAGAIN
      # It's not been observed in testing that we ever get here.
      # True to the definition, packets will be accepted and quietly dropped
      # if the system is under pressure.
      break
    rescue EOFError, Errno::ECONNRESET
      @close_scheduled = true
      @outbound_q.clear
    end
  }
end