发布于 2009-02-26 13:31:19
0楼
一台计算机读RACK0的CPMAC地址,另两台计算机读RACK1的CPMAC地址,这样CPU0出现故障时其他计算机还在通信,不会造成由于切换造成的数据丢失,其实有的时候有些问题就是一个计算机任务分配和自己使用习惯的问题,我认为能够有一个捷径解决问题就行,追求这些东西是没用的。1号计算机脚本:
#include "apdefap.h"
int gscAction( void )
{
#define TAG_0 "@sg@AlternateConnectionAddress"
#define TAG_1 "@sg@ConnectionEstablishMode"
#define TAG_2 "@sg@ConnectionState"
#define TAG_3 "@sg@ForceConnectionAddress"
#pragma code("msrtcli.dll")
#include "msrtapi.h"
#pragma code()
#pragma code( "kernel32.dll" )
VOID GetLocalTime(LPSYSTEMTIME lpSystemTime);
#pragma code()
static int Mld_Main = 0;
static int Mld_Res = 0;
DWORD ServiceID = 0;
static BOOL InitFirst = TRUE;
static MSG_RTCREATE_STRUCT MsgCreate;
CMN_ERROR Error;
if ( InitFirst == TRUE )
{ memset( &MsgCreate, 0, sizeof (MSG_RTCREATE_STRUCT) );
MsgCreate.dwMsgState = MSG_STATE_COME;
MsgCreate.wTextValueUsed = 1;
sprintf( MsgCreate.mtTextValue[0].szText, "sg" );
SetTagChar( TAG_0, "H1,08 00 06 71 88 06,,0,3,02" );//1号计算机脚本(SetTagChar( TAG_0, "H1,08 00 06 71 88 07,,1,3,02" );//2号计算机脚本
)
InitFirst = FALSE;
}
if ( GetTagDWordWait( TAG_1 ) == 0 )
{
Mld_Main = 0;
Mld_Res = 0;
return 0;
}
else
{
GetLocalTime( &MsgCreate.stMsgTime );
MSRTStartMsgService ( &ServiceID, NULL, NULL, MSG_NOTIFY_MASK_ARCHIV, NULL, &Error );
if ( GetTagDWordWait( TAG_2 ) == 0 )
{
if ( GetTagDWordWait( TAG_3 ) == 0 )
{
if ( Mld_Main == 0 )
{
MsgCreate.dwMsgNr = 1012222;
MSRTCreateMsg( ServiceID, &MsgCreate, &Error );
Mld_Main = 1;
SetTagBit("10KA",1);
}
}
else
{
if ( Mld_Res == 0 )
{
MsgCreate.dwMsgNr = 1012224;
MSRTCreateMsg( ServiceID, &MsgCreate, &Error );
Mld_Res = 1;
SetTagBit("10KA",1);
}
}
if ( GetTagDWordWait( TAG_2 ) == 0 )
{
if ( GetTagDWordWait( TAG_3 ) == 0 )
{
SetTagDWord( TAG_3, 1 );
}
else
{
SetTagDWord( TAG_3, 0 );
}
}
}
else
{
if ( ( Mld_Main != 0 ) ( Mld_Res != 0 ) )
{
Mld_Main = 0;
Mld_Res = 0;
if ( GetTagDWordWait( TAG_3 ) == 0 )
{
MsgCreate.dwMsgNr = 1012223;
MSRTCreateMsg( ServiceID, &MsgCreate, &Error );
}
else
{
MsgCreate.dwMsgNr = 1012225;
MSRTCreateMsg( ServiceID, &MsgCreate, &Error );
}
}
}
if ( ServiceID != 0 )
{
MSRTStopMsgService ( ServiceID, &Error );
}
return 1;
}
}