MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / CheckReadability

Method CheckReadability

deps/FtpClient/BlockingSocket.cpp:220–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220bool CBlockingSocket::CheckReadability() const
221{
222 ASSERT( m_hSocket!=INVALID_SOCKET );
223
224 fd_set fd;
225 FD_ZERO(&fd);
226 FD_SET(m_hSocket, &fd);
227 TIMEVAL tv = { 0, 0 };
228
229 // static_cast is necessary to avoid compiler warning under WIN32;
230 // This is no problem because the first parameter is included only
231 // for compatibility with Berkeley sockets.
232 const int iRet = _select(m_hSocket+1, &fd, NULL, NULL, &tv);
233
234 if( iRet==SOCKET_ERROR )
235 {
236 throw CBlockingSocketException(_T("Socket Error"));
237 }
238
239 return iRet == 1;
240}
241
242int CBlockingSocket::Receive(char* pch, int nSize, int nSecs) const
243{

Callers 1

GetSingleResponseLineMethod · 0.80

Calls 2

_selectFunction · 0.85

Tested by

no test coverage detected