Posting a message

send(sock_, bf, sizeof(bf), MSG_DONTROUTE); 

Reading message

 len = recv(new_conn, (char *) b.c_str(), sizeof(b.c_str()), 0); 

Why does the server receive, instead of the message that I sent, some not clear characters, and even so many. How to fix?

  • with encoding something. There were no Latin problems. but the easiest way to use the library, and not Berkeley directly, or even go to the dotnet say - KG
  • 2
    sizeof(b.c_str()) - is that how you calculate pointer size? - Pavel Mayorov
  • one
    Thank you, yes, it really was about the pointer size ... In place sizeof (var.c_str ()) MAX_PATH used everything to become good))) - Dolphin Scrub

0