diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index 76c9e284..4a0f4233 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -151,13 +151,19 @@ def _io_wait(timeout, myaddr=None, evq=None): # it piggy back on the select() in the io thread, which is a truly # lazy wait even with eventlet involvement if deadline < selectdeadline: - iosockets[0].sendto(b'\x01', (myself, iosockets[0].getsockname()[1])) + intsock = iosockets[0] + if hasattr(intsock, 'fd'): + # if in eventlet, go for the true sendto, which is less glitchy + intsock = intsock.fd + intsock.sendto(b'\x01', (myself, iosockets[0].getsockname()[1])) evt.wait() def _io_sendto(mysocket, packet, sockaddr): #Want sendto to act reasonably sane.. mysocket.setblocking(1) + if hasattr(mysocket, 'fd'): + mysocket = mysocket.fd try: mysocket.sendto(packet, sockaddr) except Exception: