removed msg minder

This commit is contained in:
Jeff Hill
2003-04-18 22:06:19 +00:00
parent ae975a8e23
commit c50837d7f5
2 changed files with 72 additions and 87 deletions
+37 -46
View File
@@ -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
View File
@@ -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 {