forked from M-Labs/artiq
1
0
Fork 0

artiq_devtool: detect a race condition during connect.

This commit is contained in:
whitequark 2016-11-21 03:10:41 +00:00
parent 7af41bd29c
commit b562b0fbc4
1 changed files with 4 additions and 0 deletions

View File

@ -116,6 +116,10 @@ def main():
local_stream, peer_addr = listener.accept() local_stream, peer_addr = listener.accept()
logger.info("Accepting %s:%s and opening SSH channel to %s:%s", logger.info("Accepting %s:%s and opening SSH channel to %s:%s",
*peer_addr, args.ip, port) *peer_addr, args.ip, port)
if get_ssh().get_transport() is None:
logger.error("Trying to open a channel before the transport is ready!")
continue
remote_stream = get_ssh().get_transport() \ remote_stream = get_ssh().get_transport() \
.open_channel('direct-tcpip', (args.ip, port), peer_addr) .open_channel('direct-tcpip', (args.ip, port), peer_addr)
while True: while True: