Esempio n. 1
0
func echoStream(s smux.Stream) {
	defer s.Close()

	fmt.Println("accepted stream")
	io.Copy(s, s) // echo everything
	fmt.Println("closing stream")
}
Esempio n. 2
0
func echoStream(s smux.Stream) {
	defer s.Close()
	log("accepted stream")
	io.Copy(&LogWriter{s}, s) // echo everything
	log("closing stream")
}