Application structuring with threads & network I/O - suggestions?



I'm developing an small network application as a test case before I go on to 
my main app - I want to make my mistakes on something small & manageable.

My thought is to create a communications thread and have all network I/O 
handled there, outside of the gtk main loop. Communications between threads 
is being handled via GtkAsyncQueues.

Right now, I'm using the GNet library and async network I/O. The problem is 
that it doesn't seem to work :-)
I can create the communications thread properly, and log into the server while 
feeding the thread commands from the main GTK loop - so I know the basic 
concept works.

The problem I'm having is that whenever I move my mouse over my app window, I 
can see in the logs that with every movement that there's an error on the 
connection, it closes, and has to reconnect again. I'm not sure if this is a 
fault with the GNet library under windows in general, or if I'm missing 
something.

So ...... does anybody have any suggestions regarding structure? Is there a 
"standard/common" structure for this type of app, or am I going about it all 
wrong? Should I be using a different network library? 

I can, if need be, roll my own network libraries - I've been using my own for 
years on Unix/Linux, but I'm really not looking forward to having to go under 
the hood to re-write them for windows.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]