1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
#include <objects/Connection.h>
|
|
|
|
#include "first-server.h"
|
1995-03-23 03:58:37 +00:00
|
|
|
#include <objects/String.h>
|
1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
id s;
|
|
|
|
|
|
|
|
if (argc > 2)
|
|
|
|
{
|
|
|
|
printf("Looking for connection named `firstserver' on host `%s'...\n",
|
|
|
|
argv[2]);
|
1995-03-23 03:58:37 +00:00
|
|
|
s = [Connection rootProxyAtName:@"firstserver"
|
|
|
|
onHost:[String stringWithCString:argv[2]]];
|
1994-11-04 16:29:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
printf("Looking for connection named `firstserver' on localhost...\n");
|
1995-03-23 03:58:37 +00:00
|
|
|
s = [Connection rootProxyAtName:@"firstserver"];
|
1994-11-04 16:29:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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");
|
1995-06-29 00:45:55 +00:00
|
|
|
[s invalidate];
|
1994-11-04 16:29:24 +00:00
|
|
|
|
|
|
|
exit(0);
|
|
|
|
}
|