logger.debug("Datagram endpoint remote_addr=%r created: "
"(%r, %r)",
remote_addr, transport, protocol)
- yield from waiter
+
+ try:
+ yield from waiter
+ except:
+ transport.close()
+ raise
+
return transport, protocol
@coroutine
protocol = protocol_factory()
waiter = futures.Future(loop=self)
transport = self._make_read_pipe_transport(pipe, protocol, waiter)
- yield from waiter
+
+ try:
+ yield from waiter
+ except:
+ transport.close()
+ raise
+
if self._debug:
logger.debug('Read pipe %r connected: (%r, %r)',
pipe.fileno(), transport, protocol)
protocol = protocol_factory()
waiter = futures.Future(loop=self)
transport = self._make_write_pipe_transport(pipe, protocol, waiter)
- yield from waiter
+
+ try:
+ yield from waiter
+ except:
+ transport.close()
+ raise
+
if self._debug:
logger.debug('Write pipe %r connected: (%r, %r)',
pipe.fileno(), transport, protocol)