Here is link to the library.
I tried it first on desktop computer and got it running in Python 2.6. Running the same code in Digi TransPort WR21 didnt work. It gave some errors in this part of the code:
Code:
def _socketpair_compat():
"""TCP/IP socketpair including Windows support"""
listensock = socket.socket(socket.AF_INET,socket.SOCK_STREAM,socket.IPPROTO_IP) listensock.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR, 1)
listensock.bind(("127.0.0.1", 0))
listensock.listen(1)
iface, port = listensock.getsockname()
sock1 = socket.socket(socket.AF_INET,socket.SOCK_STREAM,socket.IPPROTO_IP)
sock1.setblocking(0)
try:
sock1.connect(("localhost", port))
except socket.error as err:
if err.errno != errno.EINPROGRESS and err.errno != errno.EWOULDBLOCK and err.errno !=EAGAIN:
raise
sock2, address = listensock.accept()
sock2.setblocking(0)
listensock.close()
return (sock1, sock2)
Errors produced by line "sock1.connect(("localhost", port))"
gaierror: [Errno 4] getaddrinfo failed
error: [Errno 118] ERROR
I tried changing localhost to 127.0.0.1 but it didnt help. When googling about this issue, some discussions mentioned that it could also be a problem with device network settings.
Best regards,
Juha