From 7566c0f9632ede8c3e2e2d08072cfaee5d7a9357 Mon Sep 17 00:00:00 2001 From: tj Date: Fri, 27 Nov 2009 11:57:42 +0100 Subject: [PATCH] Try to fix reconnection --- irc.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/irc.go b/irc.go index 278d0f7..3440810 100644 --- a/irc.go +++ b/irc.go @@ -193,7 +193,7 @@ func handler(irc *IRCConnection) { ee.Error = error; ee.Code = ERROR; irc.EventChan <- ee; - go reconnector(irc); + reconnector(irc); } } } @@ -226,6 +226,11 @@ func connect(i *IRCConnection) os.Error { return i.Error } fmt.Printf("Connected to %s (%s)\n", i.server, i.socket.RemoteAddr()); + i.pread = make(chan string, 100); + i.pwrite = make(chan string, 100); + i.perror = make(chan os.Error, 10); + go reader(i); + go writer(i); i.pwrite <- fmt.Sprintf("NICK %s\r\n", i.nick); i.pwrite <- fmt.Sprintf("USER %s 0.0.0.0 0.0.0.0 :GolangBOT\r\n", i.user); return nil;