diff --git a/py/execnet/script/loop_socketserver.py b/py/execnet/script/loop_socketserver.py new file mode 100644 index 000000000..a2f399cfa --- /dev/null +++ b/py/execnet/script/loop_socketserver.py @@ -0,0 +1,12 @@ + +import os, sys + +if __name__ == '__main__': + directory = os.path.dirname(os.path.abspath(sys.argv[0])) + script = os.path.join(directory, 'socketserver.py') + while 1: + cmd = "python %s %s" % (script, " ".join(sys.argv[1:])) + print "starting subcommand:", cmd + f = os.popen(cmd) + for line in f: + print line, diff --git a/py/execnet/script/socketserver.py b/py/execnet/script/socketserver.py index 134714373..289523292 100755 --- a/py/execnet/script/socketserver.py +++ b/py/execnet/script/socketserver.py @@ -53,8 +53,8 @@ def bind_and_listen(hostport): old = fcntl.fcntl(serversock.fileno(), fcntl.F_GETFD) fcntl.fcntl(serversock.fileno(), fcntl.F_SETFD, old | fcntl.FD_CLOEXEC) # allow the address to be re-used in a reasonable amount of time - if os.name == 'posix' and sys.platform != 'cygwin': - serversock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + #if os.name == 'posix' and sys.platform != 'cygwin': + serversock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) serversock.bind(hostport) serversock.listen(5) @@ -83,5 +83,5 @@ if __name__ == '__main__': else: hostport = ':8888' serversock = bind_and_listen(hostport) - startserver(serversock, loop=True) + startserver(serversock, loop=False)