Пример #1
0
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
func ServeWS(socket *websocket.Conn) {
	jsonStream := oxweb.NewJSONConn(socket)

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

	ServeStream(jsonStream)
}