SFML community forums

Help => Network => Topic started by: Henry on July 17, 2021, 05:54:20 pm

Title: [SOLVED] sf::Packet doesn't work
Post by: Henry on July 17, 2021, 05:54:20 pm
Hi, a fellow newbie here, if anyone knows the solution to this problem, please help.


So, i have planned a lot about making my new multiplayer sort of game so i screw around some tcp clients and server, just experimenting how they work. i used strings to send data around but encoding and decoding them was too hard.

So i was going to use sf::Packet to send data to the server or client but when i do this:
sf::Packet newPac;
newPac << somedata;
socket.send(newPac);
 

it would give me this error: 'newPac' does not name a type
what should i do to get rid of the error?