MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / receive

Method receive

extra/yassl/src/socket_wrapper.cpp:178–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176
177
178uint Socket::receive(byte* buf, unsigned int sz)
179{
180 wouldBlock_ = false;
181
182 int recvd = recv_func_(ptr_, buf, sz);
183
184 // idea to seperate error from would block by arnetheduck@gmail.com
185 if (recvd == -1) {
186 if (get_lastError() == SOCKET_EWOULDBLOCK ||
187 get_lastError() == SOCKET_EAGAIN) {
188 wouldBlock_ = true; // would have blocked this time only
189 nonBlocking_ = true; // socket nonblocking, win32 only way to tell
190 return 0;
191 }
192 }
193 else if (recvd == 0)
194 return static_cast<uint>(-1);
195
196 return recvd;
197}
198
199
200void Socket::shutDown(int how)

Callers 1

DoProcessReplyFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected