Go语言Echo服务器代码
package main import ( "net" "io" ) func main() { serv, e := net.Listen("tcp", ":12345") if e != nil { panic(e) } defer serv.Close() for { conn, ce := serv.Accept() if ce != nil { break } go func(c net.Conn) { io.Copy(c, c) c.Close() }(conn) } }