Multiple connections in Managed C++ with TcpListener

  • Thread starter Thread starter Rob Tand
  • Start date Start date
R

Rob Tand

Hi,
I have a server application which will allow
interfacing to a database and support multiple clients
over a telnet connection. Right now I have an infinite
loop that will accept a single client connection and
continue to listen for more (over writing the first).
For obvious reasons, the application can not do anything
else while it is in this loop. Added to this is the fact
that the application runs at 99% CPU resources. What
would be a better way to do this? Create a thread to run
the listener while the rest of the application deals with
client input? Or is there a DoEvents function in Managed
C++ that I could make use of?

Thanks,
Rob
 
Use async Socket with BeginAccept/Begin* etc. It will use ThreadPool
automatically.
 
Thank you, I was able to get multiple clients to connect
with the async Socket.

-Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top