⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hapipes.h

📁 extremeDB s sample code,useful for you
💻 H
字号:
/******************************************************************* *                                                                 * *  This file is a part of the eXtremeDB-HA Application Framework  * *  Copyright (c) 2001-2006 McObject LLC                           *  *  All Rights Reserved                                            * *                                                                 * *******************************************************************//* * ++ *  * PROJECT:   eXtremeDB(tm) (c) 2003 McObject LLC * * SUBSYSTEM: HA support * * MODULE:    hapipes.h * * ABSTRACT:  definitions of pipess IPC * * * VERSION:   1.0 * * HISTORY: *            1.0- 1 SS     9-Jul-2003 Created it was * * -- *//*************************************************************************** *                Definitions of channel-over-pipes                        *  ***************************************************************************/#ifndef	_PIPES_H_#define	_PIPES_H_#ifdef CFG_PIPE_CHANNEL#include "platform.h"#include "mco.h"#include "mcoHA.h"#ifdef _WIN32_WCE#error Pipes IPC is NOT supported under Windows CE !!!#endif#ifdef __cplusplus  extern "C" {#endif/* change this as you please *//**********************************************************************        definitions of HA endpoints **********************************************************************//* * ATTENTION! In this version of haframework the last 2 symbols of master's * logical name (port number for TCP and UDP or pipename for pipes) MUST ALWAYS BE * "00". These symbols indicate the HA instance of master and are to be replaced * by the index of current HA instance. *//* *  Connection parameters for FIFO & pipes */#define CHANNEL_NAME "Named Pipes"#ifdef _WIN32  #define nw_MasterName             "\\\\.\\pipe\\test00"    // for MASTER HA instance//  #define nw_ConnectionString      "\\\\.\\pipe\\test00"      // for REPLICA//  #define nw_ConnectionString      "\\\\SEM\\pipe\\test00"//  #define nw_ConnectionString      "\\\\SEMANIN\\pipe\\test00"#else  #define nw_MasterName             "/tmp/test00"  #define nw_ConnectionString       "/tmp/test00"//  #ifndef _QNX//    #define nw_ConnectionString    "/mnt/sem1/tmp/test00"//    #define nw_ConnectionString    "/mnt/semanin/tmp/test00"//  #else//    #define nw_ConnectionString    "/net/sem1/tmp/test00"//    #define nw_ConnectionString    "/net/semanin/tmp/test00"//  #endif#endif	/**********************************************************************        definitions of HA timeouts **********************************************************************//*  Master/replica timeouts. These parameters *  are passed to the mco_HA_attach_replica() & mco_HA_attach_master() */    #define TM_ATTACH_REPLICA    1000*5 // time to establish initial connection and the initial                                    // databases synchronization#define TM_DETACH_REPLICA    1000*5 // time to disconnect a replica from the master#define TM_MASTER_COMMIT     1000*5 // total commit time (master)#define TM_REPLICA_COMMIT    1000*5 // total database update time at the replica side                                    // "replica commit"#define TM_WAIT_FOR_DATA     1000*5 // amount of time a replica waits for the next transaction.#define TM_SYNCH	     1000*10 /**< amount of time a replica waits for the synchronization					 of the 2-nd phase of commit *///#define RECONNECTION_DELAY   300#define TM_CONNECTION_TIMEOUT   1000*10#define TM_ACCEPT_TIMEOUT       1000*60#define TM_INFINITE       -1 /**< also used if the parameter is irrelevant *//* local TCP address:port for the cancel point */#define	CANCELPOINT_ADDR	"127.0.0.1:9990" // for replica#define	CANCELPOINT_PORT	"9990"           // for master#define NW_MAX_NAMELENGTH 64            // max length of base pipe name #define NW_FULL_NAMELENGTH NW_MAX_NAMELENGTH+16 // length of full pipe name#define TM_CONN_MASTER    1000*1000#define MAX_DATALENGTH 	     32767  #ifndef _WIN32    typedef struct double_pipe_t_    {      int pi;      int po;      int num;      struct double_pipe_t_ *next;    } double_pipe_t, *double_pipe_h;    typedef struct timeval     TIMEVAL;  #else    typedef struct timeval TIMEVAL;  #endif  typedef struct nw_pipename_  {    uint2            index;  }nw_pipename_t, *nw_pipename_h;  typedef struct nw_channel_  {	  mco_channel_t   mco_channel;    uint2           status;             // channel status    void *          db;                 // database handle    int2            index;              // channel index    int1            name[NW_MAX_NAMELENGTH];  #ifdef _WIN32    HANDLE          hndl;    HANDLE          event;    HANDLE          event1;  #else    double_pipe_t   hndl;  #endif  } nw_channel_t, *nw_channel_h;#ifdef __cplusplus  }#endif#endif //CFG_PIPE_CHANNEL#endif	//_PIPES_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -