Entries tagged “#web”

Mon 20 June 2016

go网络编程积累(一)

//server.go package main import ( "fmt" "net" "os" "io" ) func main() { ln, err := net.Listen("tcp", ":8888") if err != nil { fmt.Println("Can't listen") os.Exit(2) } for { conn, err := ln.Accept() if err != nil { fmt.Println("Can't accept a conn") continue } go handleConn(conn) } } func handleConn(conn ... read more
 

Tags