libs-base/Examples/first-client.m
mccallum e3e3d3ce4f Use @"" constant strings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@192 72102866-910b-0410-8b05-ffd578937521
1995-03-23 03:58:37 +00:00

36 lines
772 B
Objective-C

#include <objects/Connection.h>
#include "first-server.h"
#include <objects/String.h>
int main(int argc, char *argv[])
{
id s;
if (argc > 2)
{
printf("Looking for connection named `firstserver' on host `%s'...\n",
argv[2]);
s = [Connection rootProxyAtName:@"firstserver"
onHost:[String stringWithCString:argv[2]]];
}
else
{
printf("Looking for connection named `firstserver' on localhost...\n");
s = [Connection rootProxyAtName:@"firstserver"];
}
printf("Found connection named `firstserver'\n");
printf("Saying hello to the server\n");
if (argc > 1)
[s sayHiTo:argv[1]];
else
[s sayHiTo:"out there"];
printf("Shutting down my connection to the server\n");
[s release];
exit(0);
}