Changeset View
Changeset View
Standalone View
Standalone View
src/net.cpp
Show First 20 Lines • Show All 1,488 Lines • ▼ Show 20 Lines | for (CNode *pnode : vNodesCopy) { | ||||
pnode->fPauseRecv = | pnode->fPauseRecv = | ||||
pnode->nProcessQueueSize > nReceiveFloodSize; | pnode->nProcessQueueSize > nReceiveFloodSize; | ||||
} | } | ||||
WakeMessageHandler(); | WakeMessageHandler(); | ||||
} | } | ||||
} else if (nBytes == 0) { | } else if (nBytes == 0) { | ||||
// socket closed gracefully | // socket closed gracefully | ||||
if (!pnode->fDisconnect) { | if (!pnode->fDisconnect) { | ||||
LogPrint(BCLog::NET, "socket closed\n"); | LogPrint(BCLog::NET, "socket closed for peer=%d\n", | ||||
pnode->GetId()); | |||||
} | } | ||||
pnode->CloseSocketDisconnect(); | pnode->CloseSocketDisconnect(); | ||||
} else if (nBytes < 0) { | } else if (nBytes < 0) { | ||||
// error | // error | ||||
int nErr = WSAGetLastError(); | int nErr = WSAGetLastError(); | ||||
if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && | if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && | ||||
nErr != WSAEINTR && nErr != WSAEINPROGRESS) { | nErr != WSAEINTR && nErr != WSAEINPROGRESS) { | ||||
if (!pnode->fDisconnect) { | if (!pnode->fDisconnect) { | ||||
LogPrintf("socket recv error %s\n", | LogPrint(BCLog::NET, | ||||
NetworkErrorString(nErr)); | "socket recv error for peer=%d: %s\n", | ||||
pnode->GetId(), NetworkErrorString(nErr)); | |||||
} | } | ||||
pnode->CloseSocketDisconnect(); | pnode->CloseSocketDisconnect(); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
// | // | ||||
// Send | // Send | ||||
▲ Show 20 Lines • Show All 1,523 Lines • Show Last 20 Lines |