func run() { err := server.Listen(bridge.Addr{"127.0.0.1", 8000}) if err != nil { log.F("Bridge listen: ", err) } log.I("Start listening") for { conn, err := server.Accept() if err != nil { log.E("Bridge accept: ", err) continue } go handleConn(conn) } }
func run(listenAddr string) { listener, err := net.Listen("tcp", listenAddr) if err != nil { log.F(err) } log.I("Start listening at " + listenAddr) for { conn, err := listener.Accept() if err != nil { log.E("accept: ", err) continue } log.I("Accept connection " + conn.RemoteAddr().String()) go handleConn(conn) } }