MCPcopy Create free account
hub / github.com/amule-project/amule / ProxyRead

Method ProxyRead

src/Proxy.cpp:274–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274uint32 CProxyStateMachine::ProxyRead(CLibSocket &socket, void *buffer)
275{
276 /* Always try to read the full buffer. That explicitly demands that
277 * the socket has the flag wxSOCKET_NONE. */
278 m_lastRead = socket.Read(buffer, PROXY_BUFFER_SIZE);
279 /* Set the status of this operation */
280 m_ok = true;
281 if (m_proxyClientSocket->BlocksRead()) {
282 m_lastError = 0;
283 } else if ((m_lastError = m_proxyClientSocket->LastError()) != 0) {
284 m_ok = false;
285 }
286 // We will get a new event right away if data is left, or when new data gets available.
287 // So block for now.
288 m_canReceive = false;
289 AddDebugLogLineN(logProxy, CFormat("ProxyRead %d ok %d canrec %d") % m_lastRead % m_ok % m_canReceive);
290
291 return m_lastRead;
292}
293
294bool CProxyStateMachine::CanReceive() const
295{

Callers

nothing calls this directly

Calls 4

CFormatClass · 0.85
ReadMethod · 0.45
BlocksReadMethod · 0.45
LastErrorMethod · 0.45

Tested by

no test coverage detected