beautypg.com

Apple AppleShare 3.0 File Server Controls User Manual

Page 10

background image

VAR ServerError: Integer;

VAR SecondsLeft: LongInt): OSErr;

VAR

scPB: SCParamBlockRec;

BEGIN

scPB.pollServerPB.scCode := SCPollServer;

{ Macintosh File Sharing doesn't return scSecondsLeft }

{ so zero it. }

scPB.pollServerPB.scSecondsLeft := 0;

MySCPollServer := SyncServerDispatch(@scPB);

ServerState := scPB.pollServerPB.scServerState;

DisconnectState := scPB.pollServerPB.scDisconnectState;

ServerError := scPB.pollServerPB.scServerError;

SecondsLeft := scPB.pollServerPB.scSecondsLeft;

END;

The following segment of code gets the server state, disconnect state, server

error, and seconds-left information and stores it in global variables for

later use. (Global variables and their data types are listed in "Using Server

Control Calls," earlier in this chapter.)

err := MySCPollServer(gServerState, gDisconnectState,

gServerError, gSecondsLeft);

SCGetServerStatus

The following function calls SCGetServerStatus to get the file server's

current status information, including the server flags, the number of active

sessions, the date of the last modification of the user list, the level of

server activity, and the date of the last modification of the volume list.

Note This call is not supported by Macintosh File Sharing.

FUNCTION MySCGetServerStatus (NamePtr: StringPtr;

VAR ServerFlags: Integer;

VAR NumSessions: Integer;

VAR UserListModDate: LongInt;

VAR Activity: Integer;