Problem solve Get help with specific problems with your technologies, process and projects.

Can a server wait for n connection by sockets and threads?

I need to create a server that waits for n connection by sockets and threads. Is this possible?
Absolutely! .NET provides a great deal of support for writing multi-threaded socket applications. Since this is a server application, I'd write it as a service (use VS.NET to create a VB or VC# "Windows Service" project). Then look at the docs for System.Net.Sockets and especially at the BeginConnect, BeginReceive and BeginSendTo functions. The docs on these methods all have examples on writing asynchronous socket code that you should be able to piece together into a complete application. If you've done asynchronous sockets in native C++, doing the same thing in .NET is a relative cake walk.

Dig Deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.