I am writing a server on qt. The question is, can I in turn initialize two sockets and use them together. The fact is that I am writing a client implementation curve that creates two connections, where one receives data and the other sends.

  • sure you can. - VTT
  • I will try, I hope it will work out, it’s just not entirely clear how the input-output streams work in the very context - Amos
  • make sockets not blocking (see O_NONBLOCK) and feed them to select () functions (or a more sophisticated poll / epoll version) when you want to wait for data on any of them (not knowing which one). And so you can keep hundreds of connections in one stream - Mike

0