rtyler/Spawning

Ipv6 support

nvandamme opened this issue · 0 comments

Hi,

I've tried to add ipv6 support in Spawning and eventlet but something is wrong:

  • Spawn launch all process with right socket options but i cannot get any instances responding to my requests.

Changes I've made:

FILE: spawning controller

line 317

def bind_socket(config):
sleeptime = 0.5
host = config.get('host', '')
port = config.get('port', 8080)
from eventlet.greenio import socket
from eventlet import util
for x in range(8):
try:
#sock = api.tcp_listener((host, port))
if not ':' in host:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
else:
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
sock = util.socket_bind_and_listen(sock, (host, port))
break
except socket.error, e:
if e[0] != errno.EADDRINUSE:
raise
print "(%s) socket %s:%s already in use, retrying after %s seconds..." % (
os.getpid(), host, port, sleeptime)
api.sleep(sleeptime)
sleeptime *= 2
else:
print "(%s) could not bind socket %s:%s, dying." % (
os.getpid(), host, port)
sys.exit(1)
return sock

FILE: spawning_child.py

line 128

# host, port = sock.getsockname()
host = sock.getsockname()[0]
port = sock.getsockname()[1]

FILE: eventlet/wsgi.py

line 516

# host, port = sock.getsockname()
host = sock.getsockname()[0]
if ':' in host:
    host = '[%s]' % host
port = sock.getsockname()[1]

Anyway, spawning is a great project and blow away paste httpserver!