3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

core: implement bind host support

Closes #379.
This commit is contained in:
James Lu 2017-01-02 12:30:24 -08:00
parent 9a01a5285f
commit a3ff32c22e
2 changed files with 7 additions and 0 deletions

View File

@ -201,6 +201,10 @@ class Irc():
self.socket = socket.socket(stype) self.socket = socket.socket(stype)
self.socket.setblocking(0) self.socket.setblocking(0)
# Set the socket bind if applicable.
if 'bindhost' in self.serverdata:
self.socket.bind((self.serverdata['bindhost'], 0))
# Set the connection timeouts. Initial connection timeout is a # Set the connection timeouts. Initial connection timeout is a
# lot smaller than the timeout after we've connected; this is # lot smaller than the timeout after we've connected; this is
# intentional. # intentional.

View File

@ -88,6 +88,9 @@ servers:
recvpass: "abcd" recvpass: "abcd"
sendpass: "abcd" sendpass: "abcd"
# Set the bind host, useful for multi-homed hosts.
#bindhost: 1.2.3.4
# The full network name, used by plugins. # The full network name, used by plugins.
netname: "InspIRCd Network" netname: "InspIRCd Network"