From a0409fa8f1d3b7bb3c24eb45edc997c4547575b8 Mon Sep 17 00:00:00 2001 From: tj Date: Wed, 25 Nov 2009 20:22:06 +0100 Subject: [PATCH] Add automatic reconnect --- irc.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/irc.go b/irc.go index a76440e..980d755 100644 --- a/irc.go +++ b/irc.go @@ -30,7 +30,7 @@ func reader(irc *IRCConnection) { func writer(irc *IRCConnection) { for { b := strings.Bytes(<-irc.pwrite); - fmt.Printf("-->%s",b ); + fmt.Printf("-->%s", b); _, err := irc.socket.Write(b); if err != nil { fmt.Printf("%s\n", err); @@ -45,7 +45,7 @@ func reconnector(i *IRCConnection) { for { i.Error = connect(i); if i.Error == nil { - return; + return } } } @@ -159,10 +159,10 @@ func (irc *IRCConnection) handle_command(msg string) *IRCEvent { case "PING": e.Code = IRC_PING; e.Message = matches[2]; - // case "ERROR": - // e.Code = IRC_PING; - // e.Message = matches[2]; - // e.Error = os.ErrorString(matches[2]); + // case "ERROR": + // e.Code = IRC_PING; + // e.Message = matches[2]; + // e.Error = os.ErrorString(matches[2]); } return e; }