Week9-s2

Objectives
finih the code and continue the report

Progress
implemented the solution we talked about last week. cleaned the code. started to plan how I will write the part about what I just did (didn't wrote that much, just the missing explanation about the track manager). While I was reading the net2 source code to plan what I will write, I finaly found a way to set up links only when required. The previous implementation created every possible links at the construction of the server which was effective but inneficient since they may not all be used.

The problem was that I had to make sure that only one link to a node is running but could not syncronise the acces to the link manager which was required to make sure that an other thread do't add a link between he time an other one check that link already axist and the time it and the link to the manager. I still can't but I found out that every pieces of code that add a link to the link manager make ure it is connected before. Since I can customise this piece of code, I put the required syncronised code here.

The server star with no link. When it recieve a packet from a node, it get a local syncronisation lock, look for the node's streams in a local array. If found, it free the lock and transmit the message. Otherwise, it create the link and its streams, free the lock, register and start the link (as an already connected link) and then transmit the message.

When a new link is created by the user, it start as a not already connected link and will, consequently, get through the connection process. When a link make a connection atempt, it call a method of the server that get the local syncronisation lock, look if there is already a link for this node using the local stream array, return immadiately that the connection failed if this is the case or create the streams for the link and return that the connection succeded otherwise.

(Those two last paragraph will potentially end up somewhere in my report.)

I also worked on a poster design.

Supervisor's Comments
This looks like a really good week's work

We discussed the design of his poster. Stressed the importance of showing the key part of his project the way in which the net2 and bluetooth are integrated.

Must do some writing.