المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Handling multiple clients via Sockets



C# Programming
03-21-2011, 09:51 AM
Hey there! Been a while… took a little break from bugging you all with questions http://www.barakasoft.com/script/Forums/Images/smiley_wink.gif .

Anyways I was working on a server/client project so I could just become familiar with socket programming before I took a little "programming" break. Now that I'm going to continue it I had a few questions about trying what I'm attempting to do.

What I want is to create a Agent-Based monitoring application. So the idea would be to have the server sitting out on the WAN listening for connections from the agents. The agents will upload data and will perform more actions in the future.

So what is the best way to handle multiple connections? The connections could range anywhere from 1 to 750 agents that checkin every 30 seconds. Some products that come in mind is Labtech, Kaseya, and Zenith. I was using async sockets and see tons of people out there just creating new threads on a new connection, but surely this will kill the server when you get many connections.

Should I be using a thread pool (haven't dove into how to do this yet), creating new threads, async sockets, or what?

Thanks!