MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / handleNativeSocketError

Function handleNativeSocketError

source/kernel/knativesocket.cpp:341–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341S32 handleNativeSocketError(const std::shared_ptr<KNativeSocketObject>& s, bool write) {
342#ifdef WIN32
343 S32 result = translateNativeSocketError(s, WSAGetLastError());
344#else
345 S32 result = translateNativeSocketError(s, errno);
346#endif
347 s->error = -result;
348#ifndef BOXEDWINE_MULTI_THREADED
349 if (result == -K_EWOULDBLOCK) {
350 addWaitingNativeSocket(s);
351 if (s->blocking) {
352 if (write) {
353 BOXEDWINE_CONDITION_LOCK(s->writingCond);
354 BOXEDWINE_CONDITION_WAIT(s->writingCond);
355 BOXEDWINE_CONDITION_UNLOCK(s->writingCond);
356 } else {
357 BOXEDWINE_CONDITION_LOCK(s->readingCond);
358 BOXEDWINE_CONDITION_WAIT(s->readingCond);
359 BOXEDWINE_CONDITION_UNLOCK(s->readingCond);
360 }
361 }
362 }
363#endif
364 return result;
365}
366
367KNativeSocketObject::KNativeSocketObject(U32 domain, U32 type, U32 protocol) : KSocketObject(KTYPE_NATIVE_SOCKET, domain, type, protocol),
368 connecting(false),

Callers 14

ioctlMethod · 0.85
writeNativeMethod · 0.85
readNativeMethod · 0.85
bindMethod · 0.85
connectMethod · 0.85
listenMethod · 0.85
acceptMethod · 0.85
getsocknameMethod · 0.85
getpeernameMethod · 0.85
getsockoptMethod · 0.85
sendmsgMethod · 0.85
recvmsgMethod · 0.85

Calls 2

addWaitingNativeSocketFunction · 0.85

Tested by

no test coverage detected