code: func NewCodec(conn Conn, encode, decode func(v interface{}) error) ServerCodec {
  	codec := &jsonCodec{
  		closed: make(chan interface{}),
  		encode: encode,
  		decode: decode,
  		conn:   conn,
  	}
  	if ra, ok := conn.(ConnRemoteAddr); ok {
  		codec.remoteAddr = ra.RemoteAddr()
  	}
  	return codec
  }
docs: // NewCodec creates a new RPC server codec with support for JSON-RPC 2.0 based
  // on explicitly given encoding and decoding methods.