Boost asio - separate different chunks of data
问题 Imagine we create simple client-server app to send files from client to server. We use boost asio. Server starts listening. Client connects to the server. Client send filename and file content. But server receive just a stream of bytes. How server detect end of filename and start of file content? First idea I have is to use special delimiter. Client writes into the socket filename, then delimiter, then file content. Server uses 'read_until' to receive filename and 'read' to read file content.