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:
"""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)
iface, port = listensock.getsockname()
sock1 = socket.socket(socket.AF_INET,socket.SOCK_STREAM,socket.IPPROTO_IP)
except socket.error as err:
if err.errno != errno.EINPROGRESS and err.errno != errno.EWOULDBLOCK and err.errno !=EAGAIN:
sock2, address = listensock.accept()
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.