func OnSend(f func(*Request, *Response)) ConnOpt {
	return func(c *Conn) { c.onSend = append(c.onSend, f) }
}
OnSend causes all requests sent on conn to invoke f(req, nil) and
all responses to invoke f(nil, resp),
package jsonrpc2
import (
	"encoding/json"
	"log"
	"sync"
)
type ConnOpt func(*Conn)
func OnRecv(f func(*Request, *Response)) ConnOpt {
	return func(c *Conn) { c.onRecv = append(c.onRecv, f) }
}