MCPcopy Create free account
hub / github.com/apache/thrift / readMessageBegin

Method readMessageBegin

lib/py/src/protocol/TBinaryProtocol.py:138–156  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

136 self.trans.write(uuid.bytes)
137
138 def readMessageBegin(self):
139 sz = self.readI32()
140 if sz < 0:
141 version = sz & TBinaryProtocol.VERSION_MASK
142 if version != TBinaryProtocol.VERSION_1:
143 raise TProtocolException(
144 type=TProtocolException.BAD_VERSION,
145 message='Bad version in readMessageBegin: %d' % (sz))
146 type = sz & TBinaryProtocol.TYPE_MASK
147 name = self.readString()
148 seqid = self.readI32()
149 else:
150 if self.strictRead:
151 raise TProtocolException(type=TProtocolException.BAD_VERSION,
152 message='No protocol version header')
153 name = self.trans.readAll(sz).decode('utf-8')
154 type = self.readByte()
155 seqid = self.readI32()
156 return (name, type, seqid)
157
158 def readMessageEnd(self):
159 pass

Callers 1

testMessageFunction · 0.95

Calls 6

readI32Method · 0.95
readStringMethod · 0.95
readByteMethod · 0.95
TProtocolExceptionClass · 0.70
decodeMethod · 0.45
readAllMethod · 0.45

Tested by

no test coverage detected