Example #1
0
File: irc.go Project: hderms/irc.go
func (s *IRCServer) handle_output(w *bufio.Writer) {
	for {
		str, ok := <-s.Write
		if ok {
			colors.Println("@rSending:", str, "@w")
			w.WriteString((str + "\r\n"))
			w.Flush()
		}

	}
}
Example #2
0
File: irc.go Project: hderms/irc.go
func (s *IRCServer) check_for_pong(str_arr ...string) (was_pong bool) {
	found_pong := false
	for _, str := range str_arr {
		if strings.HasPrefix(str, "PING") {
			s.Write <- ("PONG" + str[4:len(str)-2])
			colors.Println("@g" + str + "@w")
			found_pong = true
			break
		}

	}

	return found_pong
}