MCPcopy Create free account
hub / github.com/SpartanJ/eepp / wait

Method wait

src/eepp/network/socketselector.cpp:94–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94bool SocketSelector::wait( Time timeout ) {
95 // Setup the timeout
96 timeval time;
97 time.tv_sec = static_cast<long>( timeout.asMicroseconds() / 1000000 );
98 time.tv_usec = static_cast<long>( timeout.asMicroseconds() % 1000000 );
99
100 // Initialize the set that will contain the sockets that are ready
101 mImpl->SocketsReady = mImpl->AllSockets;
102
103 // Wait until one of the sockets is ready for reading, or timeout is reached
104 // The first parameter is ignored on Windows
105 int count = select( mImpl->MaxSocket + 1, &mImpl->SocketsReady, NULL, NULL,
106 timeout != Time::Zero ? &time : NULL );
107
108 return count > 0;
109}
110
111bool SocketSelector::isReady( Socket& socket ) const {
112 SocketHandle handle = socket.getHandle();

Callers 1

~HttpMethod · 0.45

Calls 1

asMicrosecondsMethod · 0.80

Tested by

no test coverage detected