'If the socket is unconnected, socket reads with an immediate
connection refusal are ignored, and reading stops. The protocol\'s
C{connectionRefused} method is not called.'

def test_readImmediateError(self):

    udp._sockErrReadRefuse.append((-6000))
    self.addCleanup(udp._sockErrReadRefuse.remove, (-6000))
    protocol = KeepReads()
    protocol.connectionRefused = (lambda : (1 / 0))
    port = udp.Port(None, protocol)
    port.socket = StringUDPSocket(['a', socket.error((-6000)), 'b', socket.error(EWOULDBLOCK)])
    port.doRead()
    self.assertEqual(protocol.reads, ['a'])
    port.doRead()
    self.assertEqual(protocol.reads, ['a', 'b'])
