updated examples

This commit is contained in:
Josh Baker 2016-08-16 05:51:20 -07:00
parent 9d5301c35f
commit 51b9ffb439
2 changed files with 8 additions and 4 deletions

View File

@ -96,11 +96,13 @@ func main() {
} }
}, },
func(conn redcon.Conn) bool { func(conn redcon.Conn) bool {
log.Printf("accept: %s", conn.RemoteAddr()) // use this function to accept or deny the connection.
// log.Printf("accept: %s", conn.RemoteAddr())
return true return true
}, },
func(conn redcon.Conn, err error) { func(conn redcon.Conn, err error) {
log.Printf("closed: %s, err: %v", conn.RemoteAddr(), err) // this is called when the connection has been closed
// log.Printf("closed: %s, err: %v", conn.RemoteAddr(), err)
}, },
) )
if err != nil { if err != nil {

View File

@ -65,11 +65,13 @@ func main() {
} }
}, },
func(conn redcon.Conn) bool { func(conn redcon.Conn) bool {
log.Printf("accept: %s", conn.RemoteAddr()) // use this function to accept or deny the connection.
// log.Printf("accept: %s", conn.RemoteAddr())
return true return true
}, },
func(conn redcon.Conn, err error) { func(conn redcon.Conn, err error) {
log.Printf("closed: %s, err: %v", conn.RemoteAddr(), err) // this is called when the connection has been closed
// log.Printf("closed: %s, err: %v", conn.RemoteAddr(), err)
}, },
) )
if err != nil { if err != nil {