ftp.nice.ch/Attic/openStep/developer/examples/DevelopingBusinessApps.m.NIS.bs.tgz#/DevelopingBusinessApps.m.NIS.bs/PPVServer/PPVServer_main.m

This is PPVServer_main.m in view mode; [Download] [Up]

#import <Foundation/Foundation.h>
#import "ProgramServer.h"


int main (int argc, const char *argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    ProgramServer *server;
    NSConnection *defaultConn = [NSConnection defaultConnection];

    server = [[ProgramServer alloc] init];
    [defaultConn setRootObject:server];
    if ([defaultConn registerName:@"ProgramServer"] == NO) {
        NSLog(@"Failed to register server as ProgramServer. Exiting.\n");
        exit(EXIT_FAILURE);
    }

    NSLog(@"Server successfully launched.\n");
    [[NSRunLoop currentRunLoop] run];


    [pool release];
    exit(0);       // insure the process exit status is 0
    return 0;      // ...and make main fit the ANSI spec.
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.