execute shutdown locgic with lock applied

This commit is contained in:
Jeff Hill
2000-08-30 17:07:28 +00:00
parent e066e5c22a
commit 67bbc1aef2
2 changed files with 10 additions and 28 deletions

View File

@@ -512,19 +512,9 @@ tcpiiu::tcpiiu ( cac &cac, const osiSockAddr &addrIn,
*/
void tcpiiu::shutdown ()
{
bool laborNeeded;
this->lock ();
if ( this->state != iiu_disconnected ) {
this->state = iiu_disconnected;
laborNeeded = true;
}
else {
laborNeeded = false;
}
this->unlock ();
if ( laborNeeded ) {
//
// using shutdown () here initiates a graceful socket
// shutdown sequence which will linger on the CA echo
@@ -542,6 +532,7 @@ void tcpiiu::shutdown ()
this->recvPending = true;
this->clientCtx ().signalRecvActivity ();
}
this->unlock ();
}
//
@@ -558,9 +549,9 @@ tcpiiu::~tcpiiu ()
this->shutdown ();
if ( this->channelCount () ) {
char hostName[64];
this->ipToA.hostName ( hostName, sizeof ( hostName ) );
genLocalExcep ( this->clientCtx (), ECA_DISCONN, hostName );
char hostNameTmp[64];
this->ipToA.hostName ( hostNameTmp, sizeof ( hostNameTmp ) );
genLocalExcep ( this->clientCtx (), ECA_DISCONN, hostNameTmp );
}
this->disconnectAllChan ();
@@ -986,7 +977,7 @@ void tcpiiu::postMsg ()
*/
pProtoStubTCP pStub;
if ( this->curMsg.m_cmmd >= NELEMENTS ( tcpJumpTableCAC ) ) {
pStub = badTCPRespAction;
pStub = &tcpiiu::badTCPRespAction;
}
else {
pStub = tcpJumpTableCAC [this->curMsg.m_cmmd];