aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ic/examples/all-against-all/ReadMe
blob: 75032913448327ce91fb2c965681f2fb90d7bbc4 (plain) (blame)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
This is a short description on the use of Erlang,C or Java 
client and servers against each other.
The base is a client that initiates and uses a random number 
generator that lies on an server.

There are two make files, one for Unix and one for Windows,
the Unix make file is just named "Makefile", while the Windows
is named "Makefile.win32".

Instructions.
 
1) On Makefile :
   * Modify the OTPROOT variable on the Makefile to point
     to the root for your erlang instalation.
   * Modify IC and Erl_Interface versions to agree your
     OTP version.
 
2) Type "make" to build the example.


3) Start the empd deamon by using the command :
   
    epmd -daemon
 
 
4) Do this when you want to run :

  * an Erlang server.
 
    Start erlang with the options

    -setcookie <Some Cookie> -sname <SomeNodeName>
 
    In this example you should use :
 
    erl -setcookie flash -sname babbis
 
  * a C server. 

    Just type :

    server

  * a Java server.

    Set and export the CLASSPATH variable to 
    point to the java classes located in java development kit, 
    the Otp's classes and the current directory.
    Your classpath should look like this :
 
    .:<OTPROOT>/lib/ic-3.8.1/priv/ic.jar:<OTPROOT>/lib/jinterface_0.9.2/priv/OtpErlang.jar
 
    where :
 
    <OTPROOT> is the location there OTP is installed
    
    Then type :

    java server 
   
 
5) Do this when you want to run :

   * an Erlang client.

     ** If you have no valid named erlang node,
        start erlang with the options

        -setcookie <Some Cookie> -sname <SomeNodeName>
 
        In this example you should use :
 
        erl -setcookie flash -sname client
   
        On the erlang shell, type
 
        client:start().

     ** If you have a valid named erlang node, started 
        whith the same "cookie", on the erlang shell, type
 
        client:start().

  
   * a C client, just type

     client

   
   * a Java client.

   
     Set and export the CLASSPATH variable to 
     point to the java classes located in java development kit, 
     the Otp's classes and the current directory.
     Your classpath should look like this :
 
     .:<OTPROOT>/lib/ic-4.0/priv/ic.jar:<OTPROOT>/lib/jinterface_1.1/priv/OtpErlang.jar
 
     where :
 
      <OTPROOT> is the location there OTP is installed
    
     Then type :

     java client



6) Please note that :
 
   * you must always have the same cookie in order to eastablish connection
     between clients and servers.
   
   * you cannot start two servers with the same name.
     In this example all servers share the same name in order to test
     several constallations. Kill a server before starting another one.