MCPcopy Create free account
hub / github.com/catboost/catboost / WriteDataPacketHeader

Function WriteDataPacketHeader

library/cpp/netliba/v12/udp_host_protocol.h:500–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498 ///////////////////////////////////////////////////////////////////////////////
499
500 inline void WriteDataPacketHeader(char** buf, const EUdpCmd cmd, const TConnection* connection,
501 ui64 transferId, int packetId, int ackTos, ui8 netlibaColor, TOptionsVector* optVector) {
502 Y_ASSERT(IsDataCmd(cmd));
503
504 const bool ackTosIsCustom = ackTos != TOS_DEFAULT;
505 const bool netlibaColorIsCustom = netlibaColor != DEFAULT_NETLIBA_COLOR;
506
507 if (ackTosIsCustom) {
508 optVector->PacketOpt.SetAckTos(ackTos);
509 }
510 if (netlibaColorIsCustom) {
511 optVector->PacketOpt.SetColor(netlibaColor);
512 }
513 WriteTransferPacketHeader(buf, cmd, connection, transferId, optVector);
514 Write(buf, packetId);
515 }
516
517 inline bool ReadTransferHeader(const char** pktData, const char* pktEnd, ui64* transferId, const TOptionsVector& opt) {
518 *transferId = Read<ui32>(pktData);

Callers 1

AddDataToPacketQueueFunction · 0.85

Calls 4

IsDataCmdFunction · 0.85
SetAckTosMethod · 0.80
WriteFunction · 0.70

Tested by

no test coverage detected