Skip to content

armgit / Piik

Public Imported from GitHub
0

Free, open-source screen sharing for private live streams with friends. Watch together in a browser or self-host Piik. 免费开源的私密屏幕共享,支持游戏直播、一起看电影与自部署。

517 B
Raw Blame
// Modified by Piik: propagate the request context through the recorder.
package natpmp

import (
	"context"
	"time"
)

type callObserver interface {
	observeCall(msg []byte, result []byte, err error)
}

// A caller that records the RPC call.
type recorder struct {
	child    caller
	observer callObserver
}

func (n *recorder) call(ctx context.Context, msg []byte, timeout time.Duration) (result []byte, err error) {
	result, err = n.child.call(ctx, msg, timeout)
	n.observer.observeCall(msg, result, err)
	return
}