more Troubleshoot "no more data in UDP packet"
This commit is contained in:
@@ -42,7 +42,7 @@ void ResponseHandler::handleResponse(osiSockAddr* responseFrom,
|
||||
std::cerr<<"Message [0x"<<std::hex<<(int)command<<", v0x"<<std::hex
|
||||
<<int(version)<<"] received from "<<ipAddrStr<<" on "<<transport->getRemoteName()
|
||||
<<" : "<<_description<<"\n"
|
||||
<<HexDump(*payloadBuffer, payloadSize);
|
||||
<<HexDump(*payloadBuffer, payloadSize).limit(0xffff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <pv/inetAddressUtil.h>
|
||||
#include <pv/logger.h>
|
||||
#include <pv/likely.h>
|
||||
#include <pv/hexDump.h>
|
||||
|
||||
using namespace epics::pvData;
|
||||
using namespace std;
|
||||
@@ -267,13 +268,18 @@ void BlockingUDPTransport::run() {
|
||||
try {
|
||||
processBuffer(thisTransport, fromAddress, &_receiveBuffer);
|
||||
} catch(std::exception& e) {
|
||||
LOG(logLevelError,
|
||||
"an exception caught while in UDP receiveThread %s at %s:%d: %s",
|
||||
_remoteName.c_str(), __FILE__, __LINE__, e.what());
|
||||
} catch (...) {
|
||||
LOG(logLevelError,
|
||||
"unknown exception caught while in UDP receiveThread %s at %s:%d.",
|
||||
_remoteName.c_str(), __FILE__, __LINE__);
|
||||
if(IS_LOGGABLE(logLevelError)) {
|
||||
char strBuffer[64];
|
||||
sockAddrToDottedIP(&fromAddress.sa, strBuffer, sizeof(strBuffer));
|
||||
size_t epos = _receiveBuffer.getPosition();
|
||||
|
||||
// of course _receiveBuffer _may_ have been modified during processing...
|
||||
_receiveBuffer.setPosition(RECEIVE_BUFFER_PRE_RESERVE);
|
||||
_receiveBuffer.setLimit(RECEIVE_BUFFER_PRE_RESERVE+bytesRead);
|
||||
|
||||
std::cerr<<"Error on UDP RX "<<strBuffer<<" -> "<<_remoteName<<" at "<<epos<<" : "<<e.what()<<"\n"
|
||||
<<HexDump(_receiveBuffer).limit(256u);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -2998,13 +2998,9 @@ public:
|
||||
{
|
||||
if (command < 0 || command >= (int8)m_handlerTable.size())
|
||||
{
|
||||
LOG(logLevelError,
|
||||
"Invalid (or unsupported) command: %x.", (0xFF&command));
|
||||
|
||||
if(pvAccessIsLoggable(logLevelError)) {
|
||||
std::cerr<<"Invalid PVA header "<<hex<<(int)(0xFF&command)
|
||||
<<", its payload buffer\n"
|
||||
<<HexDump(*payloadBuffer, payloadSize);
|
||||
if(IS_LOGGABLE(logLevelError)) {
|
||||
std::cerr<<"Invalid (or unsupported) command: "<<std::hex<<(int)(0xFF&command)<<"\n"
|
||||
<<HexDump(*payloadBuffer, payloadSize).limit(256u);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -158,10 +158,9 @@ void ServerResponseHandler::handleResponse(osiSockAddr* responseFrom,
|
||||
LOG(logLevelError,
|
||||
"Invalid (or unsupported) command: %x.", (0xFF&command));
|
||||
|
||||
if(pvAccessIsLoggable(logLevelError)) {
|
||||
std::cerr<<"Invalid PVA header "<<hex<<(int)(0xFF&command)
|
||||
<<", its payload buffer\n"
|
||||
<<HexDump(*payloadBuffer, payloadSize);
|
||||
if(IS_LOGGABLE(logLevelError)) {
|
||||
std::cerr<<"Invalid (or unsupported) command: "<<std::hex<<(int)(0xFF&command)<<"\n"
|
||||
<<HexDump(*payloadBuffer, payloadSize).limit(256u);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user