tuweni / org.apache.tuweni.scuttlebutt.rpc / RPCCodec

RPCCodec

class RPCCodec (source)

Encoder responsible for encoding requests.

This encoder is stateful as it maintains a counter to provide different request ids over time.

Constructors

<init>

Encoder responsible for encoding requests.

RPCCodec()

Functions

encodeRequest

Encode a message as a RPC request.

static fun encodeRequest(body: String!, vararg flags: RPCFlag!): Bytes!
static fun encodeRequest(body: Bytes!, vararg flags: RPCFlag!): Bytes!
static fun encodeRequest(body: Bytes!, requestNumber: Int, vararg flags: RPCFlag!): Bytes!

Encode a message as an RPC request.

static fun encodeRequest(body: Bytes!, requestNumber: Int, flags: Byte): Bytes!

encodeResponse

Encode a message as a response to a RPC request.

static fun encodeResponse(body: Bytes!, requestNumber: Int, flagByte: Byte): Bytes!
static fun encodeResponse(body: Bytes!, requestNumber: Int, flagByte: Byte, vararg flags: RPCFlag!): Bytes!
static fun encodeResponse(body: Bytes!, requestNumber: Int, vararg flags: RPCFlag!): Bytes!

encodeStreamEndRequest

Encodes a message with the body and headers set in the appropriate way to end a stream.

static fun encodeStreamEndRequest(requestNumber: Int): Bytes!