mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 17:51:01 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1433 72102866-910b-0410-8b05-ffd578937521
39 lines
985 B
Objective-C
39 lines
985 B
Objective-C
|
|
#include <gnustep/base/Connection.h>
|
|
#include <gnustep/base/Proxy.h>
|
|
#include "first-server.h"
|
|
#include <gnustep/base/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 connectionForProxy] invalidate];
|
|
/* Although this isn't strictly necessary. The server will recognize
|
|
that we are gone, and handle it, if we just exit (or if we crash). */
|
|
|
|
exit(0);
|
|
}
|