THeaderTransport class

An transport that allows for a variable-length frame header followed by an arbitrary number of frames. Creatint 2pc as TFramedTransport

Inheritance

Constructors

THeaderTransport.new({required TTransport transport, List<bool>? supportedClients, List<Transforms>? writeTransforms, List<int>? readTransforms, Map<String, String>? readHeaders, Map<String, String>? readPersistentHeaders, Map<String, String>? writeHeaders, Map<String, String>? writePersistentHeaders, List<ClientTypes>? clientTypes, int maxLength = TFramedTransport.DEFAULT_MAX_LENGTH})

Properties

clientType ClientTypes
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
no setter
i16buf Int8List
getter/setter pair
i32buf Int8List
final
identity String
no getter
inFrame bool
Marks the end of the a message, if applicable.
getter/setter pairinherited
isOpen bool
Queries whether the transport is open. Returns true if the transport is open.
no setterinherited
maxLength_ int
getter/setter pairinherited
peerIdentity String?
no setter
protocolId int
getter/setter pair
readBuffer_ TMemoryInputTransport?
getter/setter pairinherited
readPersistentHeaders Map<String, String>
Get a persistent header when receiving requests.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transport_ TTransport
getter/setter pairinherited
underlyingTransport TTransport
no setter
writeBuffer_ TByteArrayOutputStream
getter/setter pairinherited
writeHeaders Map<String, String>
no setter
writePersistentHeaders Map<String, String>
Get a persistent header when sending requests.
no setter
zlibBufferSize int
no getter

Methods

addTransform(Transforms transform) → void
clearHeaders() → void
clearPersistentHeaders() → void
close() Future
Closes the transport.
inherited
consumeBuffer(int len) → void
Consume len bytes from the buffer.
inherited
encodeInt(ByteBuffer out, int val) → void
encodeShort(ByteBuffer out, int val) → void
Encode a big-endian 16-bit integer into an Int8List.
override
flush([bool oneway = false]) Future
Flush any pending data out of a transport buffer. Throws TTransportError if there was an error writing out data.
override
flushInfoHeaders(Infos info, Map<String, String> headers) → ByteBuffer
写入表头
getBuffer() Int8List?
Returns the bytes list
inherited
getBufferPosition() int
Returns the position in the buffer.
inherited
getBytesRemainingInBuffer() int
Returns the number of bytes available in the write buffer.
inherited
getWriteHeadersSize(Map<String, String> headers) int
获取表头长度
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open() Future
Opens the transport for reading/writing. Throws TTransportError if the transport could not be opened.
inherited
read(Int8List buffer, int offset, int length) int
Reads up to length bytes into buffer, starting at offset. Returns the number of bytes actually read. Throws TTransportError if there was an error reading data
override
readAll(Int8List buffer, int offset, int length) int
Guarantees that all of length bytes are actually read off the transport. Returns the number of bytes actually read, which must be equal to length. Throws TTransportError if there was an error reading data
inherited
readFrame() Future
override
readHeaderFormat(int headerSize, Int8List buff) → void
readString(ByteBuffer frame) String
readVarint32Buf(ByteBuffer frame) int
resetProtocol() → void
setHeader(String key, String value) → void
setPersistentHeader(String key, String value) → void
Set a persistent header. Persistent headers are sent with every request.
toString() String
A string representation of this object.
inherited
transform(ByteBuffer data) → ByteBuffer
untransform(ByteBuffer data) → ByteBuffer
write(Int8List buffer, int offset, int length) → void
Writes up to len bytes from the buffer. Throws TTransportError if there was an error writing data
inherited
writeAll(Int8List buffer) → void
Writes the bytes to the output. Throws TTransportError if there was an error writing data
inherited
writeString(ByteBuffer out, String str) → dynamic
writeVarint(ByteBuffer out, int value) → dynamic

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

ID_VERSION String
final
ID_VERSION_HEADER String
final
IDENTITY_HEADER String
final
numClientTypes int
final

Constants

HEADER_FLAGS_MASK → const int
HEADER_MAGIC → const int
HEADER_MAGIC_MASK → const int
HTTP_SERVER_MAGIC → const int
MAX_FRAME_SIZE → const int
T_BINARY_PROTOCOL → const int
T_COMPACT_PROTOCOL → const int
T_JSON_PROTOCOL → const int