Skip to content

Commit

Permalink
[core] Enable IPv6
Browse files Browse the repository at this point in the history
This is the same as dee3c95 (#217), but without removing
`self.connect((host, port))`. It seems strange that we all would have
missed it, but so far re-doing this commit seems to be working in all
the ways it's supposed to.
  • Loading branch information
embolalia committed Sep 14, 2013
1 parent 582c070 commit c09449f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions willie/irc.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,18 @@ def write(self, args, text=None):
self.writing_lock.release()

def run(self, host, port=6667):
self.initiate_connect(host, port)
try:
self.initiate_connect(host, port)
except socket.error, e:
stderr('Connection error: %s' % e.strerror)
self.hasquit = True

def initiate_connect(self, host, port):
stderr('Connecting to %s:%s...' % (host, port))
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
if self.config.core.bind_host is not None:
self.socket.bind((self.config.core.bind_host, 0))
source_address = ((self.config.core.bind_host, 0)
if self.config.core.bind_address else None)
self.set_socket(socket.create_connection((host, port),
source_address=source_address))
if self.config.core.use_ssl and has_ssl:
self.send = self._ssl_send
self.recv = self._ssl_recv
Expand Down

0 comments on commit c09449f

Please sign in to comment.