Esempio n. 1
0
func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec {
	req := &bufferPair{proto.NewBuffer(nil), proto.NewBuffer(nil)}
	resp := &bufferPair{proto.NewBuffer(nil), proto.NewBuffer(nil)}

	return &serverCodec{conn, req, resp}
}
Esempio n. 2
0
func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec {
	req := &bufferPair{proto.NewBuffer(nil), proto.NewBuffer(nil)}
	resp := &bufferPair{proto.NewBuffer(nil), proto.NewBuffer(nil)}

	return &clientCodec{conn, req, resp}
}