As I was reading the networking tutorial, here we send text to server
// Create the UDP socket
sf::SocketUDP Socket;
// Create bytes to send
char Buffer[] = "Hi guys !";
// Send data to "192.168.0.2" on port 4567
if (Socket.Send(Buffer, sizeof(Buffer), "192.168.0.2", 4567) != sf::Socket::Done)
{
// Error...
}
So could I send object of my own to there like
// Create the UDP socket
sf::SocketUDP Socket;
// Create bytes to send
player * test;
// Send data to "192.168.0.2" on port 4567
if (Socket.Send(test, sizeof(Buffer), "192.168.0.2", 4567) != sf::Socket::Done)
{
// Error...
}
So could I do like that?