#ifdef WIN32 #include #endif #include #include #define MAXPORTS 64 #define N_DRIVER_DATALENGTH 16384 // in units of words (ie 16384 => 64 Kbyte) #ifdef UNIX #include /* getenv, exit */ #include #include #include #endif extern "C" { #include } int Tcp_Port[MAXPORTS]; int SocketConnected[MAXPORTS]; int TransferSize[MAXPORTS]; int Done[MAXPORTS]; char data_buffer[MAXPORTS][N_DRIVER_DATALENGTH*sizeof(int)]; int ReadEnable[MAXPORTS]; int ACKneeded [MAXPORTS]; int Length[MAXPORTS]; int Endian[MAXPORTS]; #define TS_TCP_PORT 6500 // default port extern void link_server(); extern void initialise_buffer_area(int); int OutFlag =0; /* no file output by default */ FILE *OutStream[MAXPORTS]; char *FileName= (char *)"MBSData"; int IDs = 1; void Usage(char *progname) { fprintf(stderr,"Usage\n%s -f [file path name] -p [port] - i [IDs]\n",progname); fprintf(stderr,"\tfile path name is root of the file name used to store data (default null and no data is stored)\n"); fprintf(stderr,"\tport is the base TCP port to use (default 10305)\n"); fprintf(stderr,"\tIDs is the number of data streams to handle (default 1)\n"); exit(1); } int main(int argc, char *argv[], char *envp[]) { int i; char fname[32]; // defaults for configuration information which may be supplied via the command line for (i=0; i1) { for(i=1;i