As the title says, more Bonjour. We decided to go for a different approach today - to change our server and make use of delegation.
We managed to get the connections set up properly and were able to send and receive data on the client and server side. But, we have one problem. Since we're doing asynchronous data transfer, when the different touch evens are being called rapidly, the data being sent would be merged even before it reaches the receiving end. When this happens, unarchiving the data would cause the program to have errors, and we would not be able to display the user interactions properly.
We tried to solve the problem by applying threading, which I thought would work. Still, it failed. We didn't try doing synchronous data transfer as it would be slow if many users were to connect at the same time. We even tried to skip the unarchiving for data which exceeds a certain number of bytes, which obviously isn't the right way -.- this caused the interface to become jerky as some of the user interactions would be skipped.
Therefore, after doing some research, we realized that manual splitting and merging of the data's bytes has to be done before unarchiving on the receiving end starts. All along we were working based on the misconception that the way we send or receive is incorrect. However, that's not the case. It's actually due the the network that we're sending our data through. If data is being sent at a very fast rate, the data packets tend to be merged on the network. It has got nothing to do with the way we send or receive. It's much more of what should be on the receiving end before unarchiving the data.
Hence, we'll try out the splitting and merging of data packets on Monday to see what happens.