简体   繁体   中英

Can Tcp Server receive more messages at the same time?

In a Tcp connection, can one Tcp Server receive two or more tcp messages at the same time from some different clients?

I have to make a small tool to manage a lot of communication from somee devices and a lot of frame exchange at the same time.

Could you give me an example?

Thanks

Yes, as long as:

  1. they are on different TCP connections, and
  2. your socket reading code allows it - specifically, it won't work if you use a single reader based on Socket.Select , and
  3. you don't add any mutex/lock/etc that prevents full concurrency over the reading

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM