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

Author Topic: trying to learn sfml networking  (Read 2462 times)

0 Members and 1 Guest are viewing this topic.

vro

  • Newbie
  • *
  • Posts: 44
    • View Profile
trying to learn sfml networking
« on: August 12, 2011, 03:09:51 am »
So I've made a few games with SFML now, and so I thought a good "next step" would be to learn networking.

I'm not gonna lie it is kind of intimidating/confusing.

I was hoping someone could explain the difference/places of socks vs packets. In the first tutorial, it shows how to send a simple c-string/char array to another computer. The next tutorial shows how to send what looks like more data via packets.

So is that the main difference? Sockets for small sets of data, packets for larger data?

sknnywhiteman

  • Newbie
  • *
  • Posts: 38
    • View Profile
    • Email
trying to learn sfml networking
« Reply #1 on: August 12, 2011, 06:47:29 am »
Well, using networking like the first tutorial, you're obviously only able to send one little bit of data to another computer, and it has to be an array of characters. Packets, are streams of data, (like using std::cout) and they hold lots of different types of data, like integers, strings, the basic types, and then you can make your on structures that you can assign directly to a packet. Packets are basically ways of storing lots of different kinds of information, and sending it over the network.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
trying to learn sfml networking
« Reply #2 on: August 12, 2011, 08:09:19 am »
This is exactly the kind of question that the introduction of the packet tutorial tries to answer. Do you think it's not clear enough for beginners?
Laurent Gomila - SFML developer

vro

  • Newbie
  • *
  • Posts: 44
    • View Profile
trying to learn sfml networking
« Reply #3 on: August 12, 2011, 10:59:21 am »
OK, your explanation Sknny is what I thought the tutorials were saying.

Laurent, in retrospect I think the tutorials are fine, I think I just felt a little unsure in connecting the first two tutorials together.

 

anything