<< Click to Display Table of Contents >>

 

zetafax_logo

ZfxGetServerStatusEx

 


 

Get information about the server.

 

Syntax

 

ZFERR FAR ZfxGetServerStatusEx( ZFSESSIONHANDLE hSession, short  ServerStatusExSize, ZFSERVERSTATUSEX FAR *lpServerStatusEx)

 

Parameters

 

Parameter

Description

hSession

API session handle, as returned by ZfxAPIInit  call ServerStatusExSizeSize of structure - should be set to size of  (ZFSERVERSTATUSEX)

lpServerStatusEx

Address of a ZFSERVERSTATUSEX structure used to return status information for the server

 

Description

 

This routine gets the current status of the server (number of entries in queues etc), of each device, and of each link to a remote server.  

If the number of devices configured exceeds the lpServerStatusEx->MaxDevices  parameter, then theroutine returns information about the  firstlpServerStatusEx->MaxDevices devices, but sets the  lpServerStatusEx->lpNumDevices parameter to the total number of devices in the list. Be careful therefore to onlyread the lesserof  (lpServerStatusEx->MaxDevices) and (lpServerStatusEx->lpNumDevices)  elements of the array on return. Calling theroutine with  lpServerStatusEx->MaxDevices set to 0 will just return a count of the number  of devices. The same logic also applies to the useof  lpServerStatusEx->MaxLinks andlpServerStatusEx->lpNumLinks.

 

Return value

 

The routine returns 0 if successful, otherwise one of the following:  

ZFERR_NOT_INITIALISED

ZFERR_INVALID_PARAMETERS

ZFERR_SERVER_NOT_RUNNING

ZFERR_FILE_OPEN_ERROR

ZFERR_FILE_ERROR

ZFERR_CANT_SUBMIT_REQUEST

 

Example

 

#include  <stdio.h>

#include <zfapi.h>

...

#define DEV_LIST_SIZE 20

#define LINK_LIST_SIZE 30

 

ZFSERVERSTATUSEX ServerStatus;

ZFSERVERINFOEX ServerInfo;

ZFDEVICEINFOEX aDeviceInfo[DEV_LIST_SIZE];

ZFLINKINFOEX aLinkInfo[LINK_LIST_SIZE];

 

short NumDevices;

short NumLinks;

 

/* initialise required fields */

memset(&ServerStatus, 0, sizeof(ServerStatus));

ServerStatus.ServerInfoExSize = sizeof(ZFSERVERINFOEX);

ServerStatus.lpServerInfoEx = &ServerInfo;

ServerStatus.MaxDevices = DEV_LIST_SIZE;

ServerStatus.lpNumDevices = &NumDevices;

ServerStatus.DeviceInfoExSize = sizeof(ZFDEVICEINFOEX);

ServerStatus.lpDeviceInfoEx = aDeviceInfo;

ServerStatus.MaxLinks = LINK_LIST_SIZE;

ServerStatus.lpNumLinks = &NumLinks;

ServerStatus.LinkInfoExSize = sizeof(ZFLINKINFOEX);

ServerStatus.lpLinkInfoEx = aLinkInfo;

 

Err = ZfxGetServerStatusEx(hSession, sizeof(ZFSERVERSTATUSEX), &ServerStatus);

 

if (Err == 0)

{

  printf("Items waiting for device =  %d\n", ServerInfoEx.QueueWaitingDevice);

 

 if (NumDevices >= 1 &&  aDeviceInfo[0].szUser[0] != '\0')

 {

         printf("Device  1 processing %s:%s", aDeviceInfo[0].szUser, aDeviceInfo[0].szMsgBody);

       }

 

 if (NumLinks >= 1)

 {

 printf("%d  faxes sent OK via '%s'", aLinkInfo[0].NumSentOK, aLinkInfo[0].szRemoteServer);

 }

}

 

Related topics

Alphabetical reference

Function error returns and reference