I have the two following functions for sending and receiving packets.
void send(std::string protocol)
{
char *request=new char[protocol.size()+1];
re
I think your question is confusing, but this might help:
void receive() {
enum { max_length = 1024 };
char reply[max_length];
size_t reply_length;
std::cout << "Reply is: ";
while ( (reply_length = ba::read(s, basio::buffer(reply, max_length))) > 0) {
std::cout.write(reply, reply_length);
}
std::cout << "\n";
}