MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / poll

Method poll

src/IO/ReadBufferFromPocoSocket.cpp:143–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143bool ReadBufferFromPocoSocketBase::poll(size_t timeout_microseconds)
144{
145 /// For secure socket it is important to check if any remaining data available in underlying decryption buffer -
146 /// read always retrieves the whole encrypted frame from the wire and puts it into underlying buffer while returning only requested size -
147 /// further poll() can block though there is still data to read in the underlying decryption buffer.
148 if (available() || socket.impl()->available())
149 return true;
150
151 Stopwatch watch;
152 bool res = socket.impl()->poll(timeout_microseconds, Poco::Net::Socket::SELECT_READ | Poco::Net::Socket::SELECT_ERROR);
153 ProfileEvents::increment(ProfileEvents::NetworkReceiveElapsedMicroseconds, watch.elapsedMicroseconds());
154 return res;
155}
156
157void ReadBufferFromPocoSocketBase::setReceiveTimeout(size_t receive_timeout_microseconds)
158{

Callers

nothing calls this directly

Calls 4

incrementFunction · 0.50
availableMethod · 0.45
implMethod · 0.45
elapsedMicrosecondsMethod · 0.45

Tested by

no test coverage detected