fixed the following issues with detection of flow control mode

o the flow control contig frame thresh should be based on max array size
o it appears that the wakeup mechanism for the send thread, who sends
the flow control on/off messages was broken
o looking at full buffers isnt a perfect detection scheme compared to
the simpler approach of just checking to see if bytes are pending in
the socket before calling recv
This commit is contained in:
Jeff Hill
2009-08-13 23:29:02 +00:00
parent b867dabad0
commit b344841365
3 changed files with 49 additions and 14 deletions

View File

@@ -143,6 +143,7 @@ cac::cac (
initializingThreadsId ( epicsThreadGetIdSelf() ),
initializingThreadsPriority ( epicsThreadGetPrioritySelf() ),
maxRecvBytesTCP ( MAX_TCP ),
maxContigFrames ( contiguousMsgCountWhichTriggersFlowControl ),
beaconAnomalyCount ( 0u ),
iiuExistenceCount ( 0u )
{
@@ -215,6 +216,11 @@ cac::cac (
if ( ! this->tcpLargeRecvBufFreeList ) {
throw std::bad_alloc ();
}
unsigned bufsPerArray = this->maxRecvBytesTCP / comBuf::capacityBytes ();
if ( bufsPerArray > 1u ) {
maxContigFrames = bufsPerArray *
contiguousMsgCountWhichTriggersFlowControl;
}
}
catch ( ... ) {
osiSockRelease ();