File:  [NeXTSTEP 3.3 examples] / Examples / EnterpriseObjects / DistributedEO / DEOServer.tproj / DEOServer_main.m
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:44 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

/*
   DEOServer_main.m created by enoyau on Fri 13-Jan-1995

   You may freely copy, distribute, and reuse the code in this example.
   NeXT disclaims any warranty of any kind, expressed or implied, as to its
   fitness for any particular use.
*/

#import "DEOServer.h"

#import <foundation/NSAutoreleasePool.h>
#import <foundation/NXAutoreleaseConnection.h>

#import <machkit/NXPort.h>

#define SECOND (1000)
#define MINUTE (60 * SECOND)

int main(int argc, char *argv[]) {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    DEOServer *myServer = [[[DEOServer alloc] init] autorelease];
    NXAutoreleaseConnection *myConnection = [NXAutoreleaseConnection registerRoot:myServer withName:DEOServerName];

    [NXPort worryAboutPortInvalidation];
//    [myConnection registerForInvalidationNotification:myServer];

    do {
        [myConnection runWithTimeout:2 * MINUTE];
        
    } while([myServer hasClient]);

    [myConnection free];
    [pool release];
    return 0;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.