First completed version of cleaned up connection object.

First testing is promising
This commit is contained in:
2016-11-02 15:08:53 +01:00
parent 5f2abbb99a
commit 6c1059b307
4 changed files with 86 additions and 487 deletions

View File

@ -2349,7 +2349,7 @@ int SCGetRunLevel(SConnection *pCon)
return pCon->runLevel;
}
/*--------------------------------------------------------*/
int SCGetIdent(SConnection *pCon)
long SCGetIdent(SConnection *pCon)
{
if (!VerifyConnection(pCon)) {
return 0;
@ -2404,7 +2404,14 @@ char *SCGetDeviceID(SConnection *pCon)
}
return pCon->deviceID;
}
/*-------------------------------------------------------*/
int SCGetEnd(SConnection *pCon)
{
if (!VerifyConnection(pCon)) {
return 0;
}
return pCon->iEnd;
}
/*-------------------------------------------------------*/
void SCSetConStatus(SConnection *pCon, int conStatus)
{
@ -2476,4 +2483,28 @@ void SCSetGrab(SConnection *pCon, int iGrab)
}
pCon->iGrab = iGrab;
}
/*------------------------------------------------------------*/
void SCSetEnd(SConnection *pCon, int val)
{
if (!VerifyConnection(pCon)) {
return;
}
pCon->iEnd = val;
}
/*------------------------------------------------------------*/
void SCSetTelnet(SConnection *pCon, int val)
{
if (!VerifyConnection(pCon)) {
return;
}
pCon->iTelnet = val;
}
/*------------------------------------------------------------*/
void SCClose(SConnection *pCon)
{
if (!VerifyConnection(pCon)) {
return;
}
ANETclose(pCon->sockHandle);
pCon->iEnd = 1;
}