diff --git a/irc/socket.go b/irc/socket.go index 84e90313..4f3f94dc 100644 --- a/irc/socket.go +++ b/irc/socket.go @@ -78,14 +78,16 @@ func (socket *Socket) Write(line string) (err error) { return } - if err = socket.writer.Flush(); socket.isError(err, W) { - return - } + go socket.flush() Log.debug.Printf("%s ← %s", socket, line) return } +func (socket *Socket) flush() { + socket.isError(socket.writer.Flush(), W) +} + func (socket *Socket) isError(err error, dir rune) bool { if err != nil { if err != io.EOF {