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

Function GetSendErrorFromErrno

library/cpp/netliba/v12/udp_socket.cpp:222–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220 ///////////////////////////////////////////////////////////////////////////////
221
222 static TUdpSocket::ESendError GetSendErrorFromErrno(const int e) {
223 if (e == EHOSTUNREACH || e == ENETUNREACH) {
224 return TUdpSocket::SEND_NO_ROUTE_TO_HOST;
225 } else if (e == EINVAL) {
226 return TUdpSocket::SEND_EINVAL;
227 } else if (e == EAGAIN || e == EWOULDBLOCK || e == ENOMEM || e == ENOBUFS || e == EMSGSIZE) {
228 return TUdpSocket::SEND_BUFFER_OVERFLOW;
229 } else {
230 fprintf(stderr, "got unhandled errno: %d\n", e);
231 }
232 return TUdpSocket::SEND_EINVAL; //transfer will be canceled
233 }
234
235 TUdpSocket::ESendError TUdpSocket::SendTo(const char* buf, size_t size, const TSockAddrPair& addr, ui8 tos, const EFragFlag frag) {
236 Y_ASSERT(IsPacketsQueueEmpty());

Callers 2

SendToMethod · 0.85
FlushPacketsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected