TweetFollow Us on Twitter

AppleShare IP Additions

Volume Number: 15 (1999)
Issue Number: 2
Column Tag: ExplainIt

Crafting AppleShare IP Web and File Server Additions

by Erik Sea
Edited by Peter N Lewis

Using the AppleShare IP Web & File Server Control API

Server Additions - AppleShare IP Web & File

You're probably quite familiar with Mac OS APIs, functions, and controls. You've probably also run across AppleShare, and you've likely also used an AppleShare IP File Server. But I'll bet you didn't know that key pieces of AppleShare functionality are accessible to developers through a number of APIs. In this article, we'll only talk about the Web & File Server, but you can find out about other APIs, such as the AppleShare Registry and User Authentication Modules, by perusing the AppleShare IP SDK.

In this article, I'll go through the process of writing a simple little application (called a "server addition") that allows the user to control the W&F Server, and displays some server statistics. As I proceed, I'll pursue the occasional diversion that may inspire you but isn't directly related to the server addition I'm concocting here.

To use the code presented in this article, you'll need an AppleShare IP Web & File Server, and a copy of the latest version of the AppleShare IP SDK, which is available on the Mac OS SDK CD and on the Apple Developer web pages. While a few of these calls work with Macintosh File Sharing, the basic peer-to-peer version of AppleShare that ships with Mac OS (sometimes called Personal File Sharing), this article is focussed on the much more extensive developer API suite that is available under the full W&F Server.

Give Me Server Control

Although it is technically correct to view the Web & File Server as an application, in reality, when the server is installed on a machine it alters and extends the behavior of several parts of Mac OS. Once W&F is on a machine, you can control and monitor the server using API calls, just as you can make Mac OS API calls, whether the server is "serving" or not (although most calls are not useful when the server is not running and will simply return errors). In ASIP 6.1, there are roughly 29 API calls you can make, ranging from starting the server, to sending messages to connected users. You can also ask the server to tell you when things happen, such as when a user has connected or disconnected. The AppleShare Web & File Server also supports WebStar plugins.

The Server Control API consists of various parameter blocks used to set and retrieve information from the server. While it would take a lot of space to detail each of the various calls and parameters in this article, I've provided a brief summary in Table 1. If you want to know more on any of these, see the AppleShare IP SDK.

Table 1: Server Control Calls & Command Constants

SCStartServer                = 0   // Start the server
SCShutDown                   = 2   // Shut down the server
SCCancelShutDown             = 3   // Stop a shut down in progress
SCDisconnect                 = 4   // Disconnect a list of users
SCPollServer                 = 5   // Status: starting/running/shutting down
SCGetExpFldr                 = 6   // Info about a shared folder or volume
SCGetSetupInfo               = 7   // Get configuration info
SCSetSetupInfo               = 8   // Change configuration info
SCSendMessage                = 9   // Send message to user or users
SCGetServerStatus            = 10   // Time of last server change
SCInstallServerEventProc     = 11   // Installs a server event handler
SCRemoveServerEventProc      = 12   // Removes a server event handler
SCGetServerEventProc         = 13   // Retrieve a server event handler
SCServerVersion              = 14   // Version of AppleShare
SCSetCopyProtect             = 16   // Make file copy protected
SCClrCopyProtect             = 17   // Make file unprotected
SCDisconnectVolUsers         = 18   // Disconnect users from volumes
SCGetUserNameRec             = 19   // Retrieve connected user information
SCGetUserMountInfo           = 20   // How a user is using a volume
SCWakeServer                 = 21   // Starts a server that has been paused
SCSleepServer                = 22   // Pauses the server
SCGetCacheStats              = 23   // Cache size, utilization, hitcount
SCResetCache                 = 31   // Empty the file cache
SCGetExtUserNameRec          = 35   // Additional user information
SCServiceStateInfo           = 38   // Individual service states (FTP, etc.)
SCGetPlugInInfo              = 41   // Info about user's installed plugins
SCGetPlugInMimeType          = 42   // MIME type associated with a plugin
SCSetHistorySampleTime       = 43   // Time slice for server load monitoring
SCGetServerActivityHistory   = 44   // Server load percentages

Interestingly, the W&F Server's user interface is actually a separate application from the server, and it communicates with the server using these very same calls. Not all of the information available from these calls is exposed in the current user interface, and the possibilities for writing a server addition that displays additional information to the user are fairly wide-ranging - you could even replace the server's user interface entirely if you choose!

The application I'll be presenting is necessarily simplistic - just a modal dialog with a few bits of information and controls in it - but it provides a good foundation on which you could write a more advanced application, with more information and control organized as you see fit. And I hope you'll make it pretty and modeless!

ServerControl Demo Application

The user interface of the finished application is as seen in Figure 1. There's a button to flush the file server's data cache, some status text, and some counters. At the bottom of the screen, we have a histogram of server activity (gathered over a one day period), which shows maximum, minimum, or average usage levels, depending on what the user chooses.


Figure 1. ServerControl Demo main window.

We'll be using a modal dialog, in order to simplify the code (so I don't fill space with UI handling that's not directly related to the task at hand).

Determining if the Server is Installed

The first thing we need to do when our addition starts, after initializing all the appropriate toolbox routines, is ensure that an AppleShare IP W&F Server is installed. The easy method is to make a gestalt call, which will return an error if W&F is not installed, and the version number if it is (actually, this technique only works with 6.0 or later, but we're going to require 6.0 anyway so this is not a limitation). The source for this is in Listing 1.

Listing 1: Checking for Server and Version

extern Boolean
AppleShareIsInstalled (void) {

   Boolean   isInstalled = true;
   SInt32      asipVersion;
   OSErr      err;

   err = Gestalt (gestaltASIPFSVersion, &asipVersion);
   
   if ((err != noErr) || 
         (asipVersion < kMinimumAppleShareVersion)) {
      isInstalled = false;
   } // if

   return isInstalled;

} // AppleShareIsInstalled

Setting up the Window

Once we know that the server is there, and it's a suitable version, we can bring in the window, and handle it until closed. There's actually a bit more to it, of course. In order to count logins and file accesses, we need a server event handler (actually, we'll be counting each open of a file fork, so, if a file has both a data fork and a resource fork, a single open could be counted twice). We also need to set up the user item that draws the histogram and to ask the server to record history information using an appropriate time slice. The recommended time slice value is one sample every 84 seconds, so that with 1024 data points the server retains a full day's information. Changing the value may interfere with other programs that expect the value to be 84 seconds, so don't deviate without cause.

For the most part, we'll use global variables for communication between the server event handler, the dialog user item, and the modal dialog filter. Since AppleShare IP is PowerPC-only, we can write the addition as a PowerPC application, which means that we don't have to do anything special to use global variables.

Listing 2 shows these basic elements. We'll talk more about server event handlers and the server control calls we use in a bit.

Listing 2: Main.c

#define      kAllocateStorage         NULL
#define      kPlaceInFront            ((WindowPtr) (-1L))

// Global variables...

SInt16       gActivityType         = kWindowAvgRadioButtonIdx;
   // We map the radio group state to the current on value...
SInt32       gActiveUserCount       = 0;
   // Number of users currently logged on...
SInt32       gLoginCount             = 0;
   // Cumulative counter of login events...
SInt32       gAccessCount          = 0;
   // Cumulative counter of access events...
UInt16       gServerState          = kStateNotRunningIdx;
   // Map the server state to the string we'll display...
Boolean       gResetEnabled         = false;
   // The Reset button should be drawn enabled...
UInt32       gLastTimeServerPolled   = 0;
   // TimeStamp of the last time the server was called...
ServerHistoryRec gHistoryData;
   // Historical data last returned by the server...
ServerEventQEntry gServerEventQEntry;
   // Event handler queue entry...

// Support routines...

static void
Initialize (void) {

   // Initialize the managers we need...

   InitGraf (&qd.thePort);
   InitFonts ();
   InitWindows ();
   InitMenus ();
   TEInit ();
   InitDialogs (NULL);
   InitCursor ();

   // Initialize the data structures we'll use...

   gHistoryData.numDataPoints = 0;
   gHistoryData.historyLastSample = 0;

} // Initialize

// Main routine...

extern int
main (void) {

   DialogPtr      additionWindow;

   // Initialize the toolbox, then check for AppleShare.
   // If AppleShare is installed, go get the window,  set default control
   // and data structure values, install server event handler, and install
   // a dialog user item to draw the histogram.

   Initialize ();

   if (AppleShareIsInstalled ()) {
      additionWindow = GetNewDialog (kAdditionWindowRsrcID,
                               kAllocateStorage, kPlaceInFront);
      if (additionWindow != NULL) {
         InstallServerEventHandler ();
         SetServerTimeSlice (kOneDayTotalTimeSlice);
         SetUserItem (additionWindow, kWindowUserItemIdx,
                              DrawHistogram);
         SetDialogValues (additionWindow);
         HandleDialog (additionWindow);
         RemoveServerEventHandler ();      
      } // if
   } // if

   return 0;

} // main

Once we have the dialog in place, we need to keep it up to date. Listing 3, DialogStuff.c, contains all the basic routines for maintaining the UI. Of these routines, MonitorServerEvents and DrawHistogram merit some additional attention.

Keeping the Window Up-to-Date

Since this is a modal dialog, we ensure that the window is updated by making server control calls from the filterproc, MonitorServerEvents. The filterproc gets called fairly often but we don't want to bog down the server with all sorts of server control calls to get status and history information updated (particularly since we know the history information will only change every 84 seconds!), so we only poll every 10 seconds, which still allows us to see changes in the number of active users in a timely fashion. You might want to improve the logic here to further lighten the load on the server - nobody wants to run a server addition that impairs performance!

When the data changes, we force the histogram user item to completely redraw by invalidating its bounding rectangle from the filterproc. The user item, implemented by DrawHistogram, simply steps through the data points in the server history record, and uses them to draw vertical lines (bar chart style). For contrast, based on the radio button the user has chosen, the different activity levels (maximum, average, and minimum) are drawn in different colors. Since we allow the user to change which data to chart in the histogram, a redraw can also be forced from the HandleDialog routine, based on the radio button hit.

One quick note about how the history data are arranged by the server: the most recent sample is always in array position zero, with older data scrolling to higher positions and then disappearing. This may seem backwards, but makes sense if you envision the server history data as kind of like "activity EKG", with the recording needle fixed at the left hand side, and the tape moving to the right.

Listing 3: DialogStuff.c

#include    "ServerControlAddition.h"

extern pascal void
DrawHistogram (WindowPtr theDialog, SInt16 itemNo) {

   SInt16            itemType;
   Handle            itemHandle;
   Rect               itemRect;
   UInt16            drawItemIdx = 0;
   RGBColor         svColor;
   UInt16            drawValue;
   HistoryData*   currentPoint;
   HistoryData*   nextPoint;
   SInt16            horiz;
   SInt16            bottom;
   SInt16            top;

   // Get the item, frame it, inset by one; then draw a bar from
   // bottom to top for each defined data point, based on whether
   // we're showing minimum/maximum/average data. Now, because we
   // know that the area screen is half the number of available
   // data points (512 vs. 1024) and yet the height is twice as
   // tall (200 vs. 100 percent) we'll add pairs together. This
   // might make the last reading bogus if the number of
   // available data points is odd, but it will fix itself soon enough...
   
   GetDialogItem (theDialog, itemNo, &itemType,
         &itemHandle, &itemRect);
   FrameRect (&itemRect);
   InsetRect (&itemRect, 1, 1);
   EraseRect (&itemRect);
   GetForeColor (&svColor);
   
   while (drawItemIdx < gHistoryData.numDataPoints) {
      currentPoint = &gHistoryData.dataPoint[drawItemIdx];
      nextPoint = &gHistoryData.dataPoint[drawItemIdx+1];
      switch (gActivityType) {
         case kWindowMaxRadioButtonIdx:
            drawValue = currentPoint->dpMax +
                           nextPoint->dpMax;
            ForeColor (redColor);
            break;
         case kWindowMinRadioButtonIdx:
            drawValue = currentPoint->dpMin +
                           nextPoint->dpMin;
            ForeColor (blueColor);
            break;
         case kWindowAvgRadioButtonIdx:
         default:
            drawValue = currentPoint->dpAverage +
                           nextPoint->dpAverage;
            ForeColor (greenColor);
            break;
      } // switch
      horiz = itemRect.left + (drawItemIdx >> 1);
      bottom = itemRect.bottom - 1;
      top = bottom - drawValue;
      MoveTo (horiz, bottom);
      LineTo (horiz, top);
      drawItemIdx += 2;
   } // while

   RGBForeColor (&svColor);

} // DrawHistogram

extern void
HandleDialog (WindowPtr theDialog) {

   SInt16                  itemHit;
   ModalFilterUPP      modalFilterUPP;
   
   modalFilterUPP = NewModalFilterProc (MonitorServerEvents);

   do {
   
      ModalDialog (modalFilterUPP, &itemHit);
   
      switch (itemHit) {
      
         // For the radio buttons, we may need to update the
         // display immediately, but only if there's a change...
      
         case kWindowMaxRadioButtonIdx:
         case kWindowMinRadioButtonIdx:
         case kWindowAvgRadioButtonIdx:
            if (gActivityType != itemHit) {
               gActivityType = itemHit;
               InvalDialogItem (theDialog, kWindowUserItemIdx);
               SetDialogValues (theDialog);
            } // if
            break;
         
         // These are plain server control calls...
         
         case kWindowResetCacheButtonIdx:
            DoResetCache ();
            break;
         
         default:
            break;
         
      } // switch
   
   } while (itemHit != kStdOkItemIndex);

} // HandleDialog

extern void
SetDialogValues (DialogPtr additionWindow) {

   Str255      statusText;
   Str32      countText;

   // Update the radio group...

   TurnControlOn (additionWindow, gActivityType, true);
   if (gActivityType != kWindowMaxRadioButtonIdx) {
      TurnControlOn (additionWindow, kWindowMaxRadioButtonIdx,
                           false);
   } // if
   if (gActivityType != kWindowAvgRadioButtonIdx) {
      TurnControlOn (additionWindow, kWindowAvgRadioButtonIdx, 
                           false);
   } // if
   if (gActivityType != kWindowMinRadioButtonIdx) {
      TurnControlOn (additionWindow, kWindowMinRadioButtonIdx, 
                           false);
   } // if
   
   // Update the state text...
   
   GetIndString (statusText, kServerStateStringsRsrcID, 
                           gServerState);
   SetTextItem (additionWindow, kWindowStatusTextIdx, 
                           statusText);
   
   // Update the counters...
   
   NumToString (gActiveUserCount, countText);
   SetTextItem (additionWindow, kWindowActiveUsersTextIdx,
                         countText);
   NumToString (gLoginCount, countText);
   SetTextItem (additionWindow, kWindowLoginsTextIdx, 
                        countText);
   NumToString (gAccessCount, countText);
   SetTextItem (additionWindow, kWindowAccessesTextIdx, 
                        countText);
   
   // Update the button...
   
   SetButtonEnabled (additionWindow,
             kWindowResetCacheButtonIdx, gResetEnabled);
   
} // SetDialogValues

extern pascal Boolean
MonitorServerEvents (DialogPtr theDialog,
               EventRecord* theEvent, DialogItemIndex* itemHit) {

   // This filter gets called fairly often; if we make frequent server control
   // calls, we'll start impairing the performance of the server. So, let's 
   // only do it once every 10 seconds...

   UInt32      currentTime;
   UInt32      lastHistoryTime;

   GetDateTime (&currentTime);
   if (currentTime - gLastTimeServerPolled > 
                        kNumberOfSecondsBetweenPolls) {

      // Check for changes in the status of the server, and update
      // if necessary...

      UpdateServerStatus ();
      if (gServerState == kStateRunningIdx) {
         gResetEnabled = true;
      } else {
         gResetEnabled = false;
      } // if
      SetDialogValues (theDialog);
      
      // Since our UserItem will erase and redraw the entire histogram,
      // let's be sure it really changed before we force a redraw...
      
      lastHistoryTime = gHistoryData.historyLastSample;
      UpdateServerHistory ();
      if (lastHistoryTime != gHistoryData.historyLastSample) {
         InvalDialogItem (theDialog, kWindowUserItemIdx);
      } // if
   } // if
   
   return StdFilterProc (theDialog, theEvent, itemHit);

} // MonitorServerEvents

Talk to me, AppleShare IP

Now that we have enough of a UI in place to display what we want, and the mechanisms for keeping that UI updated, we need to write some code that actually talks to the server, updates our global variables, and populates our history buffer. Although there are 29 calls available, we're only going to need seven of them in this server addition.

Server control calls are parameter-block based, so, starting with a parameter block, you set various fields to different values, and that determines what the call actually is. The entry point is the routine ServerDispatchSync, which is defined in the header AppleShareFileServerControl.h, and implemented in the SDK library file SyncServerDispatch.c.

As can be seen in Listing 4, talking to the W&F Server is relatively straightforward: declare a parameter block, stuff in the required values, and then make the call, and retrieve the values. There are some additional things to consider for server event handlers, and we'll talk about those next.

Listing 4: Making Server Control Calls

#include    "ServerControlAddition.h"

extern void
SetServerTimeSlice (UInt32 secondsToWait) {

   OSErr                     err;
   SCParamBlockRec         pb;
   SetHistoryParamPtr   setHistoryParam;
   
   setHistoryParam = &pb.setHistoryParam;
   setHistoryParam->scCode = kSCSetHistorySampleTime;
   setHistoryParam->historySampleTime = secondsToWait;
   err = ServerDispatchSync (&pb);

} // SetServerTimeSlice

extern void
UpdateServerStatus (void) {

   OSErr                     err;
   SCParamBlockRec         pb;
   StatusParamPtr         statusParam;
   PollServerParamPtr   pollServerParam;

   // We get the number of connected users from the GetServerStatus call...

   statusParam = &pb.statusParam;
   statusParam->scNamePtr = NULL;
   statusParam->scCode = kSCGetServerStatus;
   err = ServerDispatchSync (&pb);
   if (err == noErr) {
      gActiveUserCount = statusParam->scNumSessions;
   } // if
   
   // And we get the state of the server from the PollServer call...
   
   pollServerParam = &pb.pollServerParam;
   pollServerParam->scCode = kSCPollServer;
   err = ServerDispatchSync (&pb);
   if (err == noErr) {
      switch (pollServerParam->scServerState) {
         case kSCPollRunning:
            gServerState = kStateRunningIdx;
            break;
         case kSCPollStartingUp:
            gServerState = kStateStartingIdx;
            break;
         case kSCPollSleeping:
            gServerState = kStateSleepingIdx;
            break;
         case kSCPollJustDisabled:
         case kSCPollDisabledErr:
            gServerState = kStateNotRunningIdx;
            break;
         default:
            gServerState = kStateShuttindDownIdx;
            break;
      } // switch
   } else {
      gServerState = kStateNotRunningIdx;
   } // if

} // UpdateServerStatus

extern void
UpdateServerHistory (void) {

   OSErr                     err;
   SCParamBlockRec         pb;
   GetHistoryParamPtr   getHistoryParam;
   
   getHistoryParam = &pb.getHistoryParam;
   getHistoryParam->scHistory = &gHistoryData;
   getHistoryParam->numDataPointsRequested = kSCMaxDataPoints;
   getHistoryParam->scCode = kSCGetServerActivityHistory;
   err = ServerDispatchSync (&pb);

} // UpdateServerHistory

extern void
InstallServerEventHandler (void) {

   OSErr                     err;
   SCParamBlockRec         pb;
   ServerEventParamPtr   serverEventParam;

   // Fill out the queue entry (requesting logons and opens), then
   // queue it...
   
   gServerEventQEntry.callBack = 
         NewServerEventHandlerProc (HandleServerEvents);
   gServerEventQEntry.serverEventMask = 0;
   gServerEventQEntry.afpCommandMask[0] = 0;
   gServerEventQEntry.afpCommandMask[1] = 0;
   gServerEventQEntry.serverControlMask = 0;
   SetAFPFlag (&gServerEventQEntry, afpLogin, 
                        true, false, true);
   SetAFPFlag (&gServerEventQEntry, afpOpenFork, 
                        false, true, true);

   serverEventParam = &pb.serverEventParam;
   serverEventParam->scSEQEntryPtr = 
                  (Ptr) &gServerEventQEntry;
   serverEventParam->scCode = kSCInstallServerEventProc;
   err = ServerDispatchSync (&pb);

} // InstallServerEventHandler

extern void
RemoveServerEventHandler (void) {

   OSErr                     err;
   SCParamBlockRec         pb;
   ServerEventParamPtr   serverEventParam;

   serverEventParam = &pb.serverEventParam;
   serverEventParam->scSEQEntryPtr = 
               (Ptr) &gServerEventQEntry;
   serverEventParam->scCode = kSCRemoveServerEventProc;
   err = ServerDispatchSync (&pb);

} // RemoveServerEventHandler

extern void
DoResetCache (void) {

   OSErr                     err;
   SCParamBlockRec         pb;
   ResetCacheParamPtr   resetCacheParam;
   
   resetCacheParam = &pb.resetCacheParam;
   resetCacheParam->scCode = kSCResetCache;
   resetCacheParam->bitmap = kSCShrinkAllCaches;
   err = ServerDispatchSync (&pb);

} // DoResetCache

Handling Server Events

Probably the most complicated part of the W&F API suite is in server event handling. An application (or really, any piece of code) can register to receive notifications of different kinds of events. You can receive server control event notification (lets you know when someone makes a server control call). You can receive server events (such things as when a CD has been inserted and has become sharable). And you can receive AFP events - those relating to AppleShare clients: logons, opens, closes, reads, writes - you name it. A complete list can be found in the AppleShare IP SDK, with explanations and sample code on how to set the server event block so that you get called for the events you're interested in.

For our addition, we're installing a handler that looks at two AFP events: afpLogin and afpOpenFork. You can receive event notification either before or after it has executed; if you receive the event after it has executed, you'll know what the result of the call was (for the most part, whether it succeeded or failed).

The most important part about writing a server event handler is recognizing that the server calls such handlers immediately, regardless of the state of the machine. This means that you probably don't have access to the toolbox or other routines you might need, and, just as importantly, because the server is in the middle of doing something (such as servicing a user request), your event handler should do the minimum amount of work possible. The typical strategy is to have your handler quickly queue server event records in memory you've allocated earlier, and then process those queued records in your main event loop, when you can do what you please. The SDK shows how to do this in detail.

Another thing to be careful about is not to modify server event data "in place", because, very often, the data in the server event record points to live data in the server itself, and modifying it could adversely affect the server's operation, and the server may become displeased with you. Thankfully, in this server addition, all we need to do is count events, so there is no need to queue things up - just increment the appropriate counter and continue. Listing 5 completes our application with the routines to set up the server event handler and the event handler itself.

Listing 5: Server Event Handling

extern pascal void
HandleServerEvents (ServerEventQEntry* queueEntry,
                  ExtendedServerEventRecord* event) {

   // Since this is probably not main event time, there's limits on
   // what we can do.  However, it should be safe to increment counters,
   // based on which afp command it is...
   
   if (event->eventNumber == kSCStartAFPRequestEvt) {
      switch (event->afpCommand) {
         case afpLogin:
            gLoginCount += 1;
            break;
         case afpOpenFork:
            gAccessCount += 1;
            break;
         default:
            break;
      } // switch
   } // if

} // HandleServerEvents

extern void
SetEventFlag (ServerEventQEntry* queueEntry,
         UInt32 whichEvent, Boolean onOff) {

   UInt32 maskValue = 0x1 << whichEvent;

   if (onOff) {
      queueEntry->serverEventMask |= maskValue;
   } else {
      queueEntry->serverEventMask &= ~maskValue;
   } // if

} // SetEventFlag

extern void
SetAFPFlag (ServerEventQEntry* queueEntry, UInt32 whichEvent,
         Boolean inDo, Boolean inReply, Boolean onOff) {

   UInt32 maskValue0 = 0;
   UInt32 maskValue1 = 0;
   
   // Special case of AddIcon gets remapped to bit 0.
   if (whichEvent == afpAddIcon) {
      whichEvent = 0;
   } // if
   
   if (whichEvent >= 32) {
      maskValue0 = 1 << (whichEvent % 32);
   } else {
      maskValue1 = 1 << whichEvent;
   } // if
   
   if (onOff) {
      queueEntry->afpCommandMask[0] |= maskValue0;
      queueEntry->afpCommandMask[1] |= maskValue1;
   } else {
      queueEntry->afpCommandMask[0] &= ~maskValue0;
      queueEntry->afpCommandMask[1] &= ~maskValue1;
   } // if
   
   // Set the appropriate Event flag(s) so this actually gets called.
   
   if (inDo) {
      SetEventFlag (queueEntry, kSCStartAFPRequestEvt, onOff);
   } // if
   if (inReply) {
      SetEventFlag (queueEntry, kSCStartAFPRequestEvt, onOff);
   } // if

} // SetAFPFlag

Go Write a Server Addition

I hope that this brief exposure to server control and event handling for the AppleShare IP Web & File Server has been illuminating. There are literally hundreds of events that you could process in new and different ways, and server information that you can expose to the user. Several commercial products have been written using these APIs, and AppleShare IP users are always looking for additional tools to help them better administer their servers.

With a bit of imagination, you could come up with a piece of software that fills a void or expands the usefulness of the world's easiest-to-use Web & File Server.

Happy controlling.

Related Links

http://www.apple.com/appleshareip/


Erik Sea joined the AppleShare IP team at Apple in March, 1998, as the Engineering Lead for the File Server (versions 6.0 and 6.1). Before that, he worked in the PowerBook group on such products as Apple Location Manager and its friends. When not busy coding, he can be found herding his free-range slinky collection. You can reach Erik at sea@apple.com.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Tor Browser 12.5.5 - Anonymize Web brows...
Using Tor Browser you can protect yourself against tracking, surveillance, and censorship. Tor was originally designed, implemented, and deployed as a third-generation onion-routing project of the U.... Read more
Malwarebytes 4.21.9.5141 - Adware remova...
Malwarebytes (was AdwareMedic) helps you get your Mac experience back. Malwarebytes scans for and removes code that degrades system performance or attacks your system. Making your Mac once again your... Read more
TinkerTool 9.5 - Expanded preference set...
TinkerTool is an application that gives you access to additional preference settings Apple has built into Mac OS X. This allows to activate hidden features in the operating system and in some of the... Read more
Paragon NTFS 15.11.839 - Provides full r...
Paragon NTFS breaks down the barriers between Windows and macOS. Paragon NTFS effectively solves the communication problems between the Mac system and NTFS. Write, edit, copy, move, delete files on... Read more
Apple Safari 17 - Apple's Web brows...
Apple Safari is Apple's web browser that comes bundled with the most recent macOS. Safari is faster and more energy efficient than other browsers, so sites are more responsive and your notebook... Read more
Firefox 118.0 - Fast, safe Web browser.
Firefox offers a fast, safe Web browsing experience. Browse quickly, securely, and effortlessly. With its industry-leading features, Firefox is the choice of Web development professionals and casual... Read more
ClamXAV 3.6.1 - Virus checker based on C...
ClamXAV is a popular virus checker for OS X. Time to take control ClamXAV keeps threats at bay and puts you firmly in charge of your Mac’s security. Scan a specific file or your entire hard drive.... Read more
SuperDuper! 3.8 - Advanced disk cloning/...
SuperDuper! is an advanced, yet easy to use disk copying program. It can, of course, make a straight copy, or "clone" - useful when you want to move all your data from one machine to another, or do a... Read more
Alfred 5.1.3 - Quick launcher for apps a...
Alfred is an award-winning productivity application for OS X. Alfred saves you time when you search for files online or on your Mac. Be more productive with hotkeys, keywords, and file actions at... Read more
Sketch 98.3 - Design app for UX/UI for i...
Sketch is an innovative and fresh look at vector drawing. Its intentionally minimalist design is based upon a drawing space of unlimited size and layers, free of palettes, panels, menus, windows, and... Read more

Latest Forum Discussions

See All

Listener Emails and the iPhone 15! – The...
In this week’s episode of The TouchArcade Show we finally get to a backlog of emails that have been hanging out in our inbox for, oh, about a month or so. We love getting emails as they always lead to interesting discussion about a variety of topics... | Read more »
TouchArcade Game of the Week: ‘Cypher 00...
This doesn’t happen too often, but occasionally there will be an Apple Arcade game that I adore so much I just have to pick it as the Game of the Week. Well, here we are, and Cypher 007 is one of those games. The big key point here is that Cypher... | Read more »
SwitchArcade Round-Up: ‘EA Sports FC 24’...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for September 29th, 2023. In today’s article, we’ve got a ton of news to go over. Just a lot going on today, I suppose. After that, there are quite a few new releases to look at... | Read more »
‘Storyteller’ Mobile Review – Perfect fo...
I first played Daniel Benmergui’s Storyteller (Free) through its Nintendo Switch and Steam releases. Read my original review of it here. Since then, a lot of friends who played the game enjoyed it, but thought it was overpriced given the short... | Read more »
An Interview with the Legendary Yu Suzuk...
One of the cool things about my job is that every once in a while, I get to talk to the people behind the games. It’s always a pleasure. Well, today we have a really special one for you, dear friends. Mr. Yu Suzuki of Ys Net, the force behind such... | Read more »
New ‘Marvel Snap’ Update Has Balance Adj...
As we wait for the information on the new season to drop, we shall have to content ourselves with looking at the latest update to Marvel Snap (Free). It’s just a balance update, but it makes some very big changes that combined with the arrival of... | Read more »
‘Honkai Star Rail’ Version 1.4 Update Re...
At Sony’s recently-aired presentation, HoYoverse announced the Honkai Star Rail (Free) PS5 release date. Most people speculated that the next major update would arrive alongside the PS5 release. | Read more »
‘Omniheroes’ Major Update “Tide’s Cadenc...
What secrets do the depths of the sea hold? Omniheroes is revealing the mysteries of the deep with its latest “Tide’s Cadence" update, where you can look forward to scoring a free Valkyrie and limited skin among other login rewards like the 2nd... | Read more »
Recruit yourself some run-and-gun royalt...
It is always nice to see the return of a series that has lost a bit of its global staying power, and thanks to Lilith Games' latest collaboration, Warpath will be playing host the the run-and-gun legend that is Metal Slug 3. [Read more] | Read more »
‘The Elder Scrolls: Castles’ Is Availabl...
Back when Fallout Shelter (Free) released on mobile, and eventually hit consoles and PC, I didn’t think it would lead to something similar for The Elder Scrolls, but here we are. The Elder Scrolls: Castles is a new simulation game from Bethesda... | Read more »

Price Scanner via MacPrices.net

Final weekend for Apple’s 2023 Back to School...
This is the final weekend for Apple’s Back to School Promotion 2023. It remains active until Monday, October 2nd. Education customers receive a free $150 Apple Gift Card with the purchase of a new... Read more
Apple drops prices on refurbished 13-inch M2...
Apple has dropped prices on standard-configuration 13″ M2 MacBook Pros, Certified Refurbished, to as low as $1099 and ranging up to $230 off MSRP. These are the cheapest 13″ M2 MacBook Pros for sale... Read more
14-inch M2 Max MacBook Pro on sale for $300 o...
B&H Photo has the Space Gray 14″ 30-Core GPU M2 Max MacBook Pro in stock and on sale today for $2799 including free 1-2 day shipping. Their price is $300 off Apple’s MSRP, and it’s the lowest... Read more
Apple is now selling Certified Refurbished M2...
Apple has added a full line of standard-configuration M2 Max and M2 Ultra Mac Studios available in their Certified Refurbished section starting at only $1699 and ranging up to $600 off MSRP. Each Mac... Read more
New sale: 13-inch M2 MacBook Airs starting at...
B&H Photo has 13″ MacBook Airs with M2 CPUs in stock today and on sale for $200 off Apple’s MSRP with prices available starting at only $899. Free 1-2 day delivery is available to most US... Read more
Apple has all 15-inch M2 MacBook Airs in stoc...
Apple has Certified Refurbished 15″ M2 MacBook Airs in stock today starting at only $1099 and ranging up to $230 off MSRP. These are the cheapest M2-powered 15″ MacBook Airs for sale today at Apple.... Read more
In stock: Clearance M1 Ultra Mac Studios for...
Apple has clearance M1 Ultra Mac Studios available in their Certified Refurbished store for $540 off original MSRP. Each Mac Studio comes with Apple’s one-year warranty, and shipping is free: – Mac... Read more
Back on sale: Apple’s M2 Mac minis for $100 o...
B&H Photo has Apple’s M2-powered Mac minis back in stock and on sale today for $100 off MSRP. Free 1-2 day shipping is available for most US addresses: – Mac mini M2/256GB SSD: $499, save $100 –... Read more
New low prices: Apple 14″ M2 Pro MacBook Pros...
B&H Photo has standard-configuration Apple 14″ M2 Pro MacBook Pros in stock today and on sale for $250-$300 off MSRP, each including free 1-2 day delivery to most US addresses: – 14″ 10-Core M2... Read more
9th-generation 10.2″ iPads on sale for $50-$6...
B&H Photo has Apple’s 9th generation 10.2″ WiFi iPads on sale for $50-$60 off MSRP with prices available starting at $269. Their prices are the lowest new prices available for iPads anywhere.... Read more

Jobs Board

Sublease Associate Optometrist- *Apple* Val...
Sublease Associate Optometrist- Apple Valley, CA- Target Optical Date: Sep 30, 2023 Brand: Target Optical Location: Apple Valley, CA, US, 92307 **Requisition Read more
*Apple* / Mac Administrator - JAMF - Amentum...
Amentum is seeking an ** Apple / Mac Administrator - JAMF** to provide support with the Apple Ecosystem to include hardware and software to join our team and Read more
Child Care Teacher - Glenda Drive/ *Apple* V...
Child Care Teacher - Glenda Drive/ Apple ValleyTeacher Share by Email Share on LinkedIn Share on Twitter Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
Hair Stylist - *Apple* Blossom Mall - JCPen...
Hair Stylist - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.