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

Method RecvImpl

library/cpp/netliba/socket/socket.cpp:536–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534 }
535
536 TUdpRecvPacket* TAbstractSocket::RecvImpl(TUdpHostRecvBufAlloc* buf, sockaddr_in6* srcAddr, sockaddr_in6* dstAddr) {
537 Y_ASSERT(IsValid());
538
539 const TIoVec iov = CreateIoVec(buf->GetDataPtr(), buf->GetBufSize());
540 char controllBuffer[CTRL_BUFFER_SIZE]; //used to get dst address from socket
541 TMsgHdr hdr = CreateRecvMsgHdr(srcAddr, iov, controllBuffer);
542
543 const ssize_t rv = TAbstractSocket::RecvMsgImpl(&hdr, 0);
544 if (rv < 0) {
545 Y_ASSERT(LastSystemError() == EAGAIN || LastSystemError() == EWOULDBLOCK);
546 return nullptr;
547 }
548 if (dstAddr && !ExtractDestinationAddress(hdr, dstAddr)) {
549 //fprintf(stderr, "can`t get destination ip\n");
550 }
551
552 // we extract packet and allocate new buffer only if packet arrived
553 TUdpRecvPacket* result = buf->ExtractPacket();
554 result->DataStart = 0;
555 result->DataSize = (int)rv;
556 return result;
557 }
558
559 // thread-safe
560 int TAbstractSocket::RecvMMsgImpl(TMMsgHdr* msgvec, unsigned int vlen, unsigned int flags, timespec* timeout) {

Callers

nothing calls this directly

Calls 8

IsValidFunction · 0.85
CreateIoVecFunction · 0.85
CreateRecvMsgHdrFunction · 0.85
LastSystemErrorFunction · 0.85
GetDataPtrMethod · 0.45
GetBufSizeMethod · 0.45
ExtractPacketMethod · 0.45

Tested by

no test coverage detected