removed msg minder
This commit is contained in:
+37
-46
@@ -139,14 +139,8 @@ void tcpSendThread::run ()
|
||||
this->thread.exitWaitRelease ();
|
||||
|
||||
{
|
||||
// only one recv thread at a time may call callbacks
|
||||
// - pendEvent() blocks until threads waiting for
|
||||
// this lock get a chance to run
|
||||
cacMessageProcessingMinder msgProcMinder ( this->iiu.cacRef );
|
||||
{
|
||||
epicsGuard < callbackMutex > guard ( this->cbMutex );
|
||||
this->iiu.cacRef.uninstallIIU ( guard, this->iiu );
|
||||
}
|
||||
epicsGuard < callbackMutex > guard ( this->cbMutex );
|
||||
this->iiu.cacRef.uninstallIIU ( guard, this->iiu );
|
||||
}
|
||||
|
||||
delete & this->iiu;
|
||||
@@ -332,48 +326,45 @@ void tcpRecvThread::run ()
|
||||
// - it take also the callback lock
|
||||
this->iiu.recvDog.messageArrivalNotify ( currentTime );
|
||||
|
||||
cacMessageProcessingMinder msgProcMinder ( this->iiu.cacRef );
|
||||
{
|
||||
// only one recv thread at a time may call callbacks
|
||||
// - pendEvent() blocks until threads waiting for
|
||||
// this lock get a chance to run
|
||||
epicsGuard < callbackMutex > guard ( this->cbMutex );
|
||||
// only one recv thread at a time may call callbacks
|
||||
// - pendEvent() blocks until threads waiting for
|
||||
// this lock get a chance to run
|
||||
epicsGuard < callbackMutex > guard ( this->cbMutex );
|
||||
|
||||
// force the receive watchdog to be reset every 5 frames
|
||||
unsigned contiguousFrameCount = 0;
|
||||
while ( nBytesIn ) {
|
||||
if ( nBytesIn == pComBuf->capacityBytes () ) {
|
||||
if ( this->iiu.contigRecvMsgCount >=
|
||||
contiguousMsgCountWhichTriggersFlowControl ) {
|
||||
this->iiu.busyStateDetected = true;
|
||||
}
|
||||
else {
|
||||
this->iiu.contigRecvMsgCount++;
|
||||
}
|
||||
// force the receive watchdog to be reset every 5 frames
|
||||
unsigned contiguousFrameCount = 0;
|
||||
while ( nBytesIn ) {
|
||||
if ( nBytesIn == pComBuf->capacityBytes () ) {
|
||||
if ( this->iiu.contigRecvMsgCount >=
|
||||
contiguousMsgCountWhichTriggersFlowControl ) {
|
||||
this->iiu.busyStateDetected = true;
|
||||
}
|
||||
else {
|
||||
this->iiu.contigRecvMsgCount = 0u;
|
||||
this->iiu.busyStateDetected = false;
|
||||
}
|
||||
this->iiu.unacknowledgedSendBytes = 0u;
|
||||
|
||||
this->iiu.recvQue.pushLastComBufReceived ( *pComBuf );
|
||||
pComBuf = new ( this->iiu.comBufMemMgr ) comBuf;
|
||||
|
||||
// execute receive labor
|
||||
bool protocolOK = this->iiu.processIncoming ( currentTime, guard );
|
||||
if ( ! protocolOK ) {
|
||||
this->iiu.cacRef.initiateAbortShutdown ( this->iiu );
|
||||
break;
|
||||
else {
|
||||
this->iiu.contigRecvMsgCount++;
|
||||
}
|
||||
|
||||
if ( ! this->iiu.bytesArePendingInOS ()
|
||||
|| ++contiguousFrameCount > 5 ) {
|
||||
break;
|
||||
}
|
||||
|
||||
nBytesIn = pComBuf->fillFromWire ( this->iiu );
|
||||
}
|
||||
else {
|
||||
this->iiu.contigRecvMsgCount = 0u;
|
||||
this->iiu.busyStateDetected = false;
|
||||
}
|
||||
this->iiu.unacknowledgedSendBytes = 0u;
|
||||
|
||||
this->iiu.recvQue.pushLastComBufReceived ( *pComBuf );
|
||||
pComBuf = new ( this->iiu.comBufMemMgr ) comBuf;
|
||||
|
||||
// execute receive labor
|
||||
bool protocolOK = this->iiu.processIncoming ( currentTime, guard );
|
||||
if ( ! protocolOK ) {
|
||||
this->iiu.cacRef.initiateAbortShutdown ( this->iiu );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( ! this->iiu.bytesArePendingInOS ()
|
||||
|| ++contiguousFrameCount > 5 ) {
|
||||
break;
|
||||
}
|
||||
|
||||
nBytesIn = pComBuf->fillFromWire ( this->iiu );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+35
-41
@@ -244,46 +244,43 @@ void udpiiu::recvMsg ( callbackMutex & cbMutex )
|
||||
this->recvBuf, sizeof ( this->recvBuf ), 0,
|
||||
& src.sa, & src_size );
|
||||
|
||||
cacMessageProcessingMinder msgProcMinder ( this->cacRef );
|
||||
{
|
||||
epicsGuard < callbackMutex > guard ( cbMutex );
|
||||
epicsGuard < callbackMutex > guard ( cbMutex );
|
||||
|
||||
if ( status <= 0 ) {
|
||||
if ( status <= 0 ) {
|
||||
|
||||
if ( status == 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
int errnoCpy = SOCKERRNO;
|
||||
|
||||
if ( errnoCpy == SOCK_SHUTDOWN ) {
|
||||
return;
|
||||
}
|
||||
if ( errnoCpy == SOCK_ENOTSOCK ) {
|
||||
return;
|
||||
}
|
||||
if ( errnoCpy == SOCK_EBADF ) {
|
||||
return;
|
||||
}
|
||||
if ( errnoCpy == SOCK_EINTR ) {
|
||||
return;
|
||||
}
|
||||
// Avoid spurious ECONNREFUSED bug in linux
|
||||
if ( errnoCpy == SOCK_ECONNREFUSED ) {
|
||||
return;
|
||||
}
|
||||
// Avoid ECONNRESET from disconnected socket bug
|
||||
// in windows
|
||||
if ( errnoCpy == SOCK_ECONNRESET ) {
|
||||
return;
|
||||
}
|
||||
this->printf ( "CAC: UDP recv error was \"%s\"\n",
|
||||
SOCKERRSTR (errnoCpy) );
|
||||
if ( status == 0 ) {
|
||||
return;
|
||||
}
|
||||
else if ( status > 0 ) {
|
||||
this->postMsg ( guard, src, this->recvBuf,
|
||||
(arrayElementCount) status, epicsTime::getCurrent() );
|
||||
|
||||
int errnoCpy = SOCKERRNO;
|
||||
|
||||
if ( errnoCpy == SOCK_SHUTDOWN ) {
|
||||
return;
|
||||
}
|
||||
if ( errnoCpy == SOCK_ENOTSOCK ) {
|
||||
return;
|
||||
}
|
||||
if ( errnoCpy == SOCK_EBADF ) {
|
||||
return;
|
||||
}
|
||||
if ( errnoCpy == SOCK_EINTR ) {
|
||||
return;
|
||||
}
|
||||
// Avoid spurious ECONNREFUSED bug in linux
|
||||
if ( errnoCpy == SOCK_ECONNREFUSED ) {
|
||||
return;
|
||||
}
|
||||
// Avoid ECONNRESET from disconnected socket bug
|
||||
// in windows
|
||||
if ( errnoCpy == SOCK_ECONNRESET ) {
|
||||
return;
|
||||
}
|
||||
this->printf ( "CAC: UDP recv error was \"%s\"\n",
|
||||
SOCKERRSTR (errnoCpy) );
|
||||
}
|
||||
else if ( status > 0 ) {
|
||||
this->postMsg ( guard, src, this->recvBuf,
|
||||
(arrayElementCount) status, epicsTime::getCurrent() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,11 +308,8 @@ void udpRecvThread::run ()
|
||||
epicsThreadPrivateSet ( caClientCallbackThreadId, &this->iiu );
|
||||
|
||||
if ( ellCount ( & this->iiu.dest ) == 0 ) { // X aCC 392
|
||||
cacMessageProcessingMinder msgProcMinder ( this->iiu.cacRef );
|
||||
{
|
||||
epicsGuard < callbackMutex > cbGuard ( this->cbMutex );
|
||||
genLocalExcep ( cbGuard, this->iiu.cacRef, ECA_NOSEARCHADDR, NULL );
|
||||
}
|
||||
epicsGuard < callbackMutex > cbGuard ( this->cbMutex );
|
||||
genLocalExcep ( cbGuard, this->iiu.cacRef, ECA_NOSEARCHADDR, NULL );
|
||||
}
|
||||
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user