Unexpected delimiter
Flyingbeanss opened this issue · comments
Flyingbeanss commented
Hi , I just found this repo and I'm interested with it.
I'm trying to send and recive files with TCP.
I coded based on examples.But I got some problems, the file I receive had unexpected delimiter, just like two tabs with a 'c'. I'm sure I didn't set the unpack setting.
The server just send file every 4096B and the client receive file every 4096B. Can someone help me? Thanks!
std::string data(fileContent.begin(),fileContent.end());
int datalen=data.length()
socket.broadcast(std::to_string(datalen)+"/////");
for(int i=0;i<datalen;i+=4096)
{
std::string tmpstr=data.substr(i,4096);
socket.broadcast(tmpstr);
}