Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Sending multiple packets simultaneously UDP  (Read 3820 times)

0 Members and 1 Guest are viewing this topic.

firepro20

  • Newbie
  • *
  • Posts: 22
    • View Profile
Sending multiple packets simultaneously UDP
« on: December 01, 2019, 07:42:52 pm »
Is it possible to send two packets simultaneously in UDP?

Quote
   playerData << playerXPosition << playerYPosition << bulletPtr->isAlive() << bulletPtr->getLocation().x << bulletPtr->getLocation().y;
   bulletData << bulletPtr->isAlive() << bulletPtr->getLocation().x << bulletPtr->getLocation().y;
   socket.send(playerData, sender, port);
   socket.send(bulletData, sender, port);

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Sending multiple packets simultaneously UDP
« Reply #1 on: December 02, 2019, 07:38:52 am »
No, but if you want to send the data at once, just pack it all into one Packet.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

firepro20

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Sending multiple packets simultaneously UDP
« Reply #2 on: December 04, 2019, 12:55:42 am »
Got it thanks!