SFML community forums

Help => Network => Topic started by: dvdw46290 on November 26, 2021, 03:08:56 pm

Title: having issues using std::string when sending a packet using tcp
Post by: dvdw46290 on November 26, 2021, 03:08:56 pm
hi im having issues trying to send a string in a packet.

my code for trying to set up the and send a string is copied of the website however i get an error "Unhandled exception at 0x75F2EA32 in SocketsAndSFML.exe: Microsoft C++ exception: std::length_error at memory location 0x00C0FA50." when is attempts to pack the data into the packet. ie. my code:

sf::Uint16 x = 10;
std::string s = "hello";
double d = 0.6;

sf::Packet packet;
packet << x << s << d; <-------(this is where im getting the error)

thanks for your time and any help would be greatly appreciated


 
Title: Re: having issues using std::string when sending a packet using tcp
Post by: eXpl0it3r on November 26, 2021, 04:41:54 pm
Are you mixing debug and release libraries?