www.pudn.com > Ge_opc_Server_v1.rar > OPCTHRD.CPP
// OpcThrd.cpp
//
// This file contains a sample implementation of
// Background/Async handling for the OPC server.
//
// Note that this is a VERY simple implementation intended
// (like the rest of this code) to show the basic principles.
// A 'real' imlementation would probably be much more
// sophisticated and use the apartment or free threading model
//
// Also this code is currently NOT threadsafe at this time when used InProc
// It has some minimal critical section logic to deal with the more
// obvious issues.
// But the client can still change things inside the server and groups
// while this thread is running which can potentially cause problems.
//
// (c) COPYRIGHT 1997, INTELLUTION INC.
// ALL RIGHTS RESERVED
//
// Original Author: Al Chisholm
//
// Modification Log:
// Vers Date By Notes
// ---- -------- --- -----
// 0.90 04/08/97 ACC add async logic
//
//
#define WIN32_LEAN_AND_MEAN
#include "OPCLHEpipeview.h"
#include "OPCTHRD.h"
#define N_SERVERS 10
///////////////////////////////////////
// The list of server objects being managed
//
struct {
BOOL inuse;
LHEpipeviewServer *pServer;
}slist[N_SERVERS];
///////////////////////////////////////
// Initialization at startup (EXE start or DLL load)
//
void InitServerSlots(void)
{
int i;
for(i=0; iUpdateData(tics);
}
}
}
}