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
|
|
|
|
|
|
|
@implementation FirstServer
|
|
|
|
- sayHiTo: (char *)name
|
|
|
|
{
|
|
|
|
printf("Hello, %s.\n", name);
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
id s, c;
|
|
|
|
|
|
|
|
/* Create our server object */
|
|
|
|
s = [[FirstServer alloc] init];
|
|
|
|
|
|
|
|
/* Register a connection that provides the server object to the network */
|
|
|
|
printf("Registering a connection for the server using name `firstserver'\n");
|
1995-03-23 03:58:37 +00:00
|
|
|
c = [Connection newRegisteringAtName:@"firstserver"
|
1994-11-04 16:29:24 +00:00
|
|
|
withRootObject:s];
|
|
|
|
|
|
|
|
/* Run the connection */
|
|
|
|
printf("Running the connection... (until you interrupt with control-C)\n");
|
|
|
|
[c runConnection]; /* This runs until interrupt. */
|
|
|
|
|
|
|
|
exit(0);
|
|
|
|
}
|