What is the best way to listen to many TCP connections?

The task is to make an answering machine for a single instant messengers
I have implemented an asynchronous TCP client
so when running 30-40 accounts everything is fine
when I add 100+ not all messages I hear
prompt in what direction to look
ideally you want to keep 1K+ connections
March 19th 20 at 08:51
2 answers
March 19th 20 at 08:53
Each connection is a separate thread.
In General, I would like to know what you mean by "not all messages I hear".
Asynchronous TcpListener does NOT require for each connection a separate thread. And you can easily implement a processing of a plurality of connections don't use additional threads. - eva84 commented on March 19th 20 at 08:56
@eva84, +1 to make each connection thread is complete nonsense, spending on stack + time to switch the context... approach typical javista, otherwise do not call - jovany.Cronin commented on March 19th 20 at 08:59
@eva84, I agree, my blemish, not saw there "I have implemented an asynchronous TCP client". - madge.DAmore10 commented on March 19th 20 at 09:02
@jovany.Cronin, alas, but Java I don't like - madge.DAmore10 commented on March 19th 20 at 09:05
March 19th 20 at 08:55
Be sure to keep both open 1000+ connections - no need. The connection can be set when sending a message and closing immediately upon receipt. Check the application architecture. Other (dead-end) way to increase the availability of iron.

Find more questions by tags C#.NETXMPP