Add a patch from the grugq to allow binding to a specific interface in api.connect_tcp.
This commit is contained in:
@@ -102,12 +102,15 @@ def ssl_listener(address, certificate, private_key):
|
|||||||
socket.is_secure = True
|
socket.is_secure = True
|
||||||
return socket
|
return socket
|
||||||
|
|
||||||
def connect_tcp(address):
|
def connect_tcp(address, localaddr=None):
|
||||||
"""
|
"""
|
||||||
Create a TCP connection to address (host, port) and return the socket.
|
Create a TCP connection to address (host, port) and return the socket.
|
||||||
|
Optionally, bind to localaddr (host, port) first.
|
||||||
"""
|
"""
|
||||||
from eventlet import greenio, util
|
from eventlet import greenio, util
|
||||||
desc = greenio.GreenSocket(util.tcp_socket())
|
desc = greenio.GreenSocket(util.tcp_socket())
|
||||||
|
if localaddr is not None:
|
||||||
|
desc.bind(localaddr)
|
||||||
desc.connect(address)
|
desc.connect(address)
|
||||||
return desc
|
return desc
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@@ -6,7 +6,7 @@ from setuptools import find_packages, setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='eventlet',
|
name='eventlet',
|
||||||
version='0.6',
|
version='0.7pre',
|
||||||
description='Coroutine-based networking library',
|
description='Coroutine-based networking library',
|
||||||
author='Linden Lab',
|
author='Linden Lab',
|
||||||
author_email='eventletdev@lists.secondlife.com',
|
author_email='eventletdev@lists.secondlife.com',
|
||||||
|
Reference in New Issue
Block a user