home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
NMPIPE.ZIP
/
NMPIPE.H
< prev
next >
Wrap
Text File
|
1992-03-07
|
2KB
|
48 lines
#define INCL_DOS
#define INCL_DOSERRORS
#define INCL_DOSSEMAPHORES
#define INCL_DOSMISC
#include <os2.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <process.h>
#include <string.h>
//#include <netcons.h>
//#include <access.h> Uncomment if using lan apis to get workstation name
//#include <wksta.h>
#define StackSize 4096
#define PipeName "\\PIPE\\LANMON.DAT"
#define SemName "\\SEM32\\LANMON.SEM"
#define Here ""
struct irec {
char computername[16]; // was CNLEN+1
ULONG counter; /* collection counter */
ULONG base; /* collection base */
ULONG Interval; /* collection interval */
ULONG current; /* The change in counter value this time */
ULONG last ; /* The counter value at last check */
ULONG last_msecs; /* The millisecond value at our last check */
ULONG current_msecs; /* The millisec. value now. */
ULONG base_msecs; /* The millisec. value during calibration */
ULONG delta_msec; /* The number of millisecs between checks */
HPIPE ClientHandle; // handle of pipe for this client, set by server
// struct stat_workstation_0 workstats; // lan api for requester stats
// struct stat_server_0 serverstats; // lan api for server stats
} inforec;
typedef struct irec *PIREC;
#define Server_ReadSize sizeof(inforec)
#define Server_WriteSize sizeof(inforec.Interval)
#define Client_ReadSize Server_WriteSize
#define Client_WriteSize Server_ReadSize
// wait for pipe available
#define WaitForPipe 5000L
#define PipeMsgHdr sizeof(USHORT)
// initial calibration cycle time
#define CalibrateTime 2000L