This page is designed for developers who wish to extend the Collaborative Environment . It will give you a general outline of the source code provided.
The networking uses the multi-cast protocol used with the multi-casting address of 220.127.116.11 and the port number of 44444 for receiving and sending data across the network.
1.1 Sending Data
Sending data is done using Java implemednted in MyDataTransmitter.java.
1.2 Receiving Data
Receiving data is done through signals in SystemJ implemented in DocEditor.sysj. The xml file DocEditor.xml binds the signals used in SystemJ with the underlying Muti-cast server.
1.3 Serialisation and De-serialisation of data
When sending or receiving data, it is important that the data be serialised and de-serialised using the same protocol for processing. It is implemented in three files, MyDataTransmitter.java, MulticastServer.java and MySystemJDeserializer.java.
2. Packet Handling
There are 10 types of packets used in the program. Each type of packet is handled in different ways. This differentiation of different types of packets is done in SystemJ program. When the program receives any incoming data, SystemJ construct will call a specific group of Java methods to process them.
It is very much possible that sending and receiving of data is out-of-order, or packets are lost across the network. It is very critical for document writers to lose even a letter or two where the whole meaning of the document may differ without intention. To compensate for this loss or incorrect ordering of packets, a buffer is implemented for each node in the network. This buffer is used to keep track of what each node has sent or received. In addition, each packet is packed with a packet number such as 1, 2, 3.. . Thus, when a receiver has found that it has received a packet that is not the next sequence, (eg. 3 instead of 2), it requests the sender to send that packet again. This ensures the correct ordering and sending of packets across the network.
3. Java Graphical User Interface
A graphical user interface (GUI) is implemented in Java. The code for the GUI is explaind with comments within the code itself.