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

Method waitForEvents

source/kernel/knativesocket.cpp:839–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837}
838
839void KNativeSocketObject::waitForEvents(BOXEDWINE_CONDITION& parentCondition, U32 events) {
840 if (events & K_POLLIN) {
841 BOXEDWINE_CONDITION_ADD_PARENT(this->readingCond, parentCondition);
842 } else {
843 BOXEDWINE_CONDITION_REMOVE_PARENT(this->readingCond, parentCondition);
844 }
845 if (events & K_POLLOUT) {
846 BOXEDWINE_CONDITION_ADD_PARENT(this->writingCond, parentCondition);
847 } else {
848 BOXEDWINE_CONDITION_REMOVE_PARENT(this->writingCond, parentCondition);
849 }
850 if (events == 0) {
851 removeWaitingSocket(this->nativeSocket);
852 } else {
853 std::shared_ptr< KNativeSocketObject> t = std::dynamic_pointer_cast<KNativeSocketObject>(shared_from_this());
854 addWaitingNativeSocket(t);
855 }
856}
857
858U32 KNativeSocketObject::writeNative(U8* buffer, U32 len) {
859 S32 result = (S32)::send(this->nativeSocket, (const char*)buffer, len, 0);

Callers

nothing calls this directly

Calls 2

removeWaitingSocketFunction · 0.85
addWaitingNativeSocketFunction · 0.85

Tested by

no test coverage detected