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

Method Send

deps/FtpClient/BlockingSocket.cpp:195–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195int CBlockingSocket::Send(const char* pch, int nSize, int nSecs) const
196{
197 ASSERT( pch != NULL );
198 ASSERT( m_hSocket!=INVALID_SOCKET );
199
200 // returned value will be less than nSize if client cancels the reading
201 fd_set fd;
202 FD_ZERO(&fd);
203 FD_SET(m_hSocket, &fd);
204 TIMEVAL tv = { nSecs, 0 };
205
206 if( _select(m_hSocket+1, NULL, &fd, NULL, &tv)==0 )
207 {
208 throw CBlockingSocketException(_T("Send timeout"));
209 }
210
211 const int nBytesSent = send(m_hSocket, pch, nSize, 0);
212 if( nBytesSent==SOCKET_ERROR )
213 {
214 throw CBlockingSocketException(_T("Send"));
215 }
216
217 return nBytesSent;
218}
219
220bool CBlockingSocket::CheckReadability() const
221{

Callers

nothing calls this directly

Calls 2

_selectFunction · 0.85

Tested by

no test coverage detected