mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Initial revision
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
commit
3a43130da6
248 changed files with 40027 additions and 0 deletions
34
Examples/first-client.m
Normal file
34
Examples/first-client.m
Normal file
|
@ -0,0 +1,34 @@
|
|||
|
||||
#include <objects/Connection.h>
|
||||
#include "first-server.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: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 free];
|
||||
|
||||
exit(0);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue