File: Client.t

package info (click to toggle)
tom 1.1.1-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,340 kB
  • ctags: 2,244
  • sloc: objc: 27,863; ansic: 9,804; sh: 7,411; yacc: 3,377; lex: 966; asm: 208; makefile: 62; cpp: 10
file content (48 lines) | stat: -rw-r--r-- 990 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<copyright> 
    Written by <a href="mailto:tiggr@ics.ele.tue.nl">Pieter J. Schoenmakers</a>

    Copyright &copy; 1997 Pieter J. Schoenmakers.

    This file is part of TOM.  TOM is distributed under the terms of the
    TOM License, a copy of which can be found in the TOM distribution; see
    the file LICENSE.

    <id>$Id: Client.t,v 1.5 1998/01/05 00:55:26 tiggr Exp $</id>
    </copyright>

implementation class Server: State end;
implementation instance Server

deferred void
  say selector what
   to All object;

end;

implementation class
Client: State

int
  main Array arguments
{
  InetHost h = [InetHost named "localhost"];
  ConnectedInetPort p = [ConnectedInetPort with 1237 at [h addresses][0]];

  ConnectedConnection con = [[ConnectedConnection alloc] initWithPort p];

  [Server ([con root]) say selector ("v_hello") to [self new]];
  [[RunLoop current] run];
}

end;

implementation instance
Client

void
  hello
{
  [[[stdio out] print "Hello, world!"] nl];
}

end;