Wednesday, February 28, 2007

LoneSeek improvements

Although I should have learned for my Cisco skill based test tomorrow I have improved LoneSeek. I am now working the chat functionality, and I have implemented the following things today:
  • Support for listing all available chat rooms.
  • Code for joining a chat room is there but not tested, I suppose there are still some bugs in it.
And I have fixed some bugs:
  • Removed a bug in the code which reads String arrays off a SoulSeek packet which caused the LoneSeek framework to hang up.
  • Using ReadBytes() now instead of Read() since Read() might not read ALL data as requested but just what it can. Read() was causing huge packets to be splitted up when the data were received with a little delay.
  • Fixed a bug where an event is being invoked without being checked if it is null.
There is still one issue I cannot resolve though: I am using a seperated thread to handle the incoming data and another one to process the packets. The first thread is reading the data, assembling the packet ships it to a queue. The second thread then dequeues the packets and dispatches them. The dispatching progress also requires the call of the events, so the event listeners get notified. But the use of threads require the event listener to use Invoke() everytime it is updating GUI controls. Has anyone a fix for that?

No comments: