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

Author Topic: How do I use the network-sockets source code?  (Read 2712 times)

0 Members and 1 Guest are viewing this topic.

Chuckleluck

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
How do I use the network-sockets source code?
« on: March 07, 2012, 07:20:51 pm »
Hello,
I decided to try out the source code provided in the "Network - Using Sockets" tutorial on the website.
How exactly do I use it?  I have 2 specific questions:
- What IP should I enter on the client?  I'm running the client and server on separate computers, but on the same local network.
- Do I have to do any preliminary actions before running the client and server, such as port forwarding?

Thanks in advance.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
How do I use the network-sockets source code?
« Reply #1 on: March 07, 2012, 07:54:14 pm »
Quote
What IP should I enter on the client? I'm running the client and server on separate computers, but on the same local network.

Then you should enter the local IP of the server, something like 192.168.x.x. You can find it with "ipconfig" on Windows, "ifconfig" on Linux.

Quote
Do I have to do any preliminary actions before running the client and server, such as port forwarding?

Depends, if only your router is blocking ports then it should be ok as long as you stay in your private network, but if you have a firewall app you'll probably have to open the corresponding port.
Laurent Gomila - SFML developer

Chuckleluck

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
How do I use the network-sockets source code?
« Reply #2 on: March 07, 2012, 08:22:05 pm »
I use Norton Antivirus, so I created a rule allowing my program through.  I entered the IP on the client side, and waited a few seconds.  It didn't send me any message other than "press enter to exit".  Is that how the program is supposed to run?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
How do I use the network-sockets source code?
« Reply #3 on: March 07, 2012, 08:36:01 pm »
Quote
Is that how the program is supposed to run?

Probably not. But you should run the Sockets example instead. Examples are more maintained than tutorial source, and always up-to-date.
Laurent Gomila - SFML developer

Chuckleluck

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
How do I use the network-sockets source code?
« Reply #4 on: March 12, 2012, 04:30:07 pm »
Where would I find the sockets example?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
How do I use the network-sockets source code?
« Reply #5 on: March 12, 2012, 04:33:43 pm »
In the SFML SDK.
Laurent Gomila - SFML developer

 

anything