forked from mirror/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
402 B
20 lines
402 B
8 years ago
|
package natpmp
|
||
|
|
||
|
import "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(msg []byte, timeout time.Duration) (result []byte, err error) {
|
||
|
result, err = n.child.call(msg, timeout)
|
||
|
n.observer.observeCall(msg, result, err)
|
||
|
return
|
||
|
}
|