search

Home  >  Q&A  >  body text

c++ - Are there any good ideas for multi-threaded socket sending and receiving?

A is the client’s socket
B is the server’s socket
A connect B TCP connection

Equal to A B establishing a tunnel

Various local requests are made to A, relayed to B for post-processing, and a bunch of data is returned

Then the question comes,
Is there any good solution to distinguish this pile of data and reply to the initiator?

大家讲道理大家讲道理2765 days ago1671

reply all(2)I'll reply

  • 扔个三星炸死你

    扔个三星炸死你2017-07-06 10:36:26

    zeromq

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-07-06 10:36:26

    Use higher-level protocols, such as HTTP.
    Otherwise, encapsulate additional information (ID, type, ...) in request and response?

    reply
    0
  • Cancelreply