SQUID Functions

 

  • The SQUID functions, and their examples, assume that the SQUID server has been started with an address of http://localhost:8000.
  • Validation of the function calls can be handled by checking the return value and calling SquidGetLastError().

 

Entries in SquidRefresh (1)

Thursday
Feb212013

SquidRefresh

  • All cached information will be written to SQUID and be available to all users.
  • Calls SquidIsDirty. If not dirty, nothing is done (all has been written).

Prototype

int SquidRefresh(int iSquid, char* sParam);

  • Parameters
iSquidSquid Connection Handle
sParamString containing the name of the column
  • Return Values
0Operation successful
-1Error occurred, call SquidGetLastError for details

Example

// SquidSendData 10000 times, wrapped in SquidPause/SquidResume calls and
// calling SquidRefresh every 1000 sends.
int iSquid;
lr_load_dll("SQUID-REST.dll");
iSquid = SquidConnect("http://localhost:8000");
SquidPause (iSquid, "col");
for (i=1; i<=10000; i++)
{
if (i==5000)
{
lr_output_message("dirty=%d", SquidIsDirty(iSquid,"col"));
}
sprintf (strBuffer, "LR-SEND3-%03d-%05d", iVuserId, i);
SquidSendData (iSquid, "col", strBuffer);
if (i % 1000 == 0)
{
SquidRefresh (iSquid, "col");
}
if (i==5000)
{
lr_output_message("dirty=%ld", SquidIsDirty(iSquid,"col"));
}
}
SquidResume (iSquid, "col");
SquidDisconnect(iSquid0;