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

Function convert_events

util/network/socket.cpp:106–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104static const size_t nevpairs_to_unix = sizeof(evpairs_to_unix) / sizeof(evpairs_to_unix[0]);
105
106static int convert_events(int events, const evpair* evpairs, size_t nevpairs, bool ignoreUnknown) noexcept {
107 int result = 0;
108 for (size_t i = 0; i < nevpairs; ++i) {
109 int event = evpairs[i].event;
110 if (events & event) {
111 events ^= event;
112 long winEvent = evpairs[i].winevent;
113 if (winEvent == -1) {
114 return -1;
115 }
116 if (winEvent == 0) {
117 continue;
118 }
119 result |= winEvent;
120 }
121 }
122 if (events != 0 && !ignoreUnknown) {
123 return -1;
124 }
125 return result;
126}
127
128class TWSAEventHolder {
129private:

Callers 1

pollFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected