Logo Search packages:      
Sourcecode: agenda.app version File versions  Download package

test-client.m

#include <Foundation/Foundation.h>
#include "CalendarManager.h"

static CalendarManager *server;
static CalendarDomain *_domain;
static CalendarUser *_user;
static NSString * userName;

static int gsleep;

void print_help(char *cmd);

@interface TestObject:NSObject
@end

int main(int argc, char **argv, char **env)
{
      NSAutoreleasePool *pool;
      id proxy;
      pool = [NSAutoreleasePool new];
      NSString *domainName;

      if (argc > 1)
      {
            gsleep = atoi(argv[1]);
      }
      else gsleep = 0;

      domainName = @"localhost";

      [NSProcessInfo initializeWithArguments:argv count:argc environment:env];


      proxy = [NSConnection rootProxyForConnectionWithRegisteredName:@"Agendum"
                                                                                            host:nil];
      if (proxy == nil)
      {
            fprintf(stderr, "Cannot connect to server\n");
            exit(1);
      }

      server = nil;
      while (server == nil)
      {
            server = [proxy calendarManagerWithDomainNamed:@"localhost"
                                            authenticateWithUserName:@"first"
                                                                    password:@"anythingx"];
            if (server == nil)
                  sleep(1);
      }

      NSLog(@"xx %@",[[server calendarUser] name]);
      [[NSConnection defaultConnection] invalidate];


      exit(0);
}

Generated by  Doxygen 1.6.0   Back to index