| 837 | } |
| 838 | |
| 839 | void 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 | |
| 858 | U32 KNativeSocketObject::writeNative(U8* buffer, U32 len) { |
| 859 | S32 result = (S32)::send(this->nativeSocket, (const char*)buffer, len, 0); |
nothing calls this directly
no test coverage detected