示例#1
0
文件: main.go 项目: rhettg/oxweb
func serveTCP(conn net.Conn) {
	defer conn.Close()

	defer func() {
		if err := recover(); err != nil {
			log.Println("serveTCP failed:", err)
		}
	}()

	jsonStream := oxweb.NewJSONConn(conn)

	ServeStream(jsonStream)
}
示例#2
0
文件: main.go 项目: rhettg/oxweb
func ServeWS(socket *websocket.Conn) {
	jsonStream := oxweb.NewJSONConn(socket)

	/*
			defer func() {
		        if err := recover(); err != nil {
		            log.Println("ServeWS failed:", err)
		        }
		    }()
	*/

	ServeStream(jsonStream)
}