MCPcopy Create free account
hub / github.com/ByConity/ByConity / tryReceivePacket

Method tryReceivePacket

src/Core/MySQL/PacketEndpoint.cpp:36–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36bool PacketEndpoint::tryReceivePacket(IMySQLReadPacket & packet, UInt64 millisecond)
37{
38 if (millisecond != 0)
39 {
40 ReadBufferFromPocoSocket * socket_in = typeid_cast<ReadBufferFromPocoSocket *>(in);
41
42 if (!socket_in)
43 throw Exception(ErrorCodes::LOGICAL_ERROR, "LOGICAL ERROR: Attempt to pull the duration in a non socket stream");
44
45 if (!socket_in->poll(millisecond * 1000))
46 return false;
47 }
48
49 packet.readPayload(*in, sequence_id);
50 return true;
51}
52
53void PacketEndpoint::resetSequenceId()
54{

Callers 1

readOneBinlogEventMethod · 0.80

Calls 3

readPayloadMethod · 0.80
ExceptionClass · 0.50
pollMethod · 0.45

Tested by

no test coverage detected