source: trunk/src/testing/ui/connectionManager/README @ 4

Revision 4, 4.9 KB checked in by ajaworski, 13 years ago (diff)

Added modified SAGE sources

Line 
1###################################################
2               
3           SAGE Users Server README
4
5###################################################
6(last updated on Semptember 19, 2005)   
7
8
9
10
11(1) REQUIREMENTS:
12-----------------
13
14- Python 2.3            (www.python.org)
15
16
17
18(2) HOW TO RUN:
19---------------
20
21- python UsersServer.py [UI_PORT] [SAGE_PORT] &
22- "&" is added at the end so that the server can run in the background even when you log out (on Linux only)
23- UI_PORT is an optional parameter for specifying on which port will the server accept connections from the SAGE UIs
24- SAGE_PORT is an optional parameter for specifying on which port will the server accept connections from the fsManagers
25- NOTE: you must specify both ports at the same time (or no ports at all)
26
27
28- to run the admin tool:
29  python admin.py [XMLRPC_SERVER_IP] [XMLRPC_SERVER_PORT]
30- the XMLRPC server is started up when the usersServer is started and is constantly running on port 8008.
31- the IP is just the IP of the machine where the usersServer is running.
32- NOTE: this tool should only be used in case something goes wrong and some sockets are still left open even though the connections should have closed.
33
34
35(3) MORE INFORMATION:
36----------------------
37
38DEFAULT PORTS USED:
39- 15555 for SAGE UI connections (i.e. user connections)
40- 15556 for SAGE connections (fsManagers)
41- 8008  for XMLRPC server (for the admin.py tool connection)
42
43LOGGING:
44the usersServer logs all activity in a local file "log.txt", however the content of the messages is not logged. The format is very crude but it still gives an idea of what was happening if something goes wrong. Some major events such as connection/disconnection of SAGE and SAGE UI have timestamps on them.
45
46MESSAGES:
47  ------------------------------------------------------------
48  All messages are sent in this format (as strings):
49  code
50  data
51
52  For example:
53  "2002"\n
54  "Ratko"
55 
56  Note that every line is separated by a newline character.
57
58
59  All machines are always keyed by IP that the users should connect to to control SAGE
60  All users are always keyed by their username, hence the username checking (for duplicates)
61  All messages are of fixed size and that's currently 2048 bytes
62
63
64  The format for every message is explained below:
65
66  <<< UI  --->  SERVER >>>
67  CODE    FORMAT                 MESSAGE
68  ----------------------------------------------------------------
69  2000    username                register this user with the Users server
70          info
71          machine_ip              the machines the user is connected to
72          machine_ip
73          ...
74
75  2001    from={username}         send a chat message to one person or to all
76          to={"all" | ip}         ip = specific to users connected to a sepcific SAGE machine
77          message
78
79  2002    username                check username for duplicates
80
81  2003    username                unregister this username from the machine specified
82          machine_ip
83
84         
85  <<< SERVER  --->  UI >>>
86  CODE    FORMAT                 MESSAGE
87  ----------------------------------------------------------------
88 
89  30000   machine_name            a status list of all the MACHINES registered with the server
90          ip
91          port
92          alive={"1" | "0"}       if the machine is alive, send 1, otherwise send 0
93          displayInfo             in this format: "Xtiles Ytiles totalWidth totalHeight tileWidth tileHeight"
94          "!#%$"               < --- a break between different blocks of data
95          machine_name
96          ip
97          port
98          alive={"1" | "0"}       if the machine is alive, send 1, otherwise send 0
99          displayInfo             in this format: "Xtiles Ytiles totalWidth totalHeight tileWidth tileHeight"
100          "!#%$"
101          ....
102
103
104  30001   username                receive a list of USERS that are connected and their info
105          info
106          machine_ip              the machines the user is connected to
107          machine_ip
108          "!#%$"               < --- a break between different users' info
109          username
110          info
111          machine_ip
112          "!#%$"
113          ....
114
115  30002   from={username}         receive a chat message from one person,
116          to={"all" | ip}        ip = specific to users connected to a specific SAGE machine
117          message
118
119  30003   "1" | "0"              1=username OK, 0=username already in use
120
121  31000   message                an informative message... just any string
122
123
124
125  <<< SAGE  --->  SERVER >>>
126  CODE    FORMAT                 MESSAGE
127  ----------------------------------------------------------------
128 
129  100     machine_name           "i am alive" message from SAGE
130          ip                   < --- machine ip and port that SAGE UIs should connect to
131          port
132          displayInfo             in this format: "Xtiles Ytiles totalWidth totalHeight tileWidth tileHeight"
133
134
135
136---------------------------------------------
137September 19, 2005
138Ratko Jagodic - rjagodic@evl.uic.edu
Note: See TracBrowser for help on using the repository browser.