golang 监听端口

package main import ( "fmt" "log" "net" "bufio" "io" ) func handleConnection(conn net.Conn) { br := bufio.NewReader(conn) for{ data, err := br.ReadString('\n') if err == io.EOF{ break } fmt.Printf("%s", data) fmt.Fprintf(conn, "OK\n") } conn.Close() ...阅读全文

2015-04-16 17:23 cauckfgf
阅读:15252 评论:0