Author Topic: Sockets Server Side  (Read 3727 times)

0 Members and 1 Guest are viewing this topic.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Sockets Server Side
« on: January 10, 2013, 10:34:27 pm »
Hey, I already wondered this a long time: How do I handle sockets on the server? I know how to do it on the client, and I mean more a general concept, but I put it in C/C++ programming help as for specific code examples i'd be good in C++.
Thanks for any help :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Sockets Server Side
« Reply #1 on: January 10, 2013, 10:36:56 pm »
Hey, I already wondered this a long time: How do I handle sockets on the server? I know how to do it on the client, and I mean more a general concept, but I put it in C/C++ programming help as for specific code examples i'd be good in C++.
Thanks for any help :D

Actually, I can't help you... but on Cemetech chat earlier today, there was a discussion about using this with gCn. (there eventually was an argument about programming langs though)
I am Bach.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sockets Server Side
« Reply #2 on: January 10, 2013, 10:45:12 pm »
Hey, I already wondered this a long time: How do I handle sockets on the server? I know how to do it on the client, and I mean more a general concept, but I put it in C/C++ programming help as for specific code examples i'd be good in C++.
Thanks for any help :D

Actually, I can't help you... but on Cemetech chat earlier today, there was a discussion about using this with gCn. (there eventually was an argument about programming langs though)
This is a more general question, not gCn related, because I am planning some other big things (hint hint hint) which are a lot easier socket wise than some workarounds.

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: Sockets Server Side
« Reply #3 on: January 11, 2013, 12:44:59 pm »
What is it??? A MOBA, MMO, Online Multiplayer thingymabob?
I am Bach.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Sockets Server Side
« Reply #4 on: January 11, 2013, 12:48:48 pm »
To handle sockets server side, you pretty much just need to have a function listening on a specific port. When it receives a message, it stores the relevant data (client address, etc) and spins off a handler.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Sockets Server Side
« Reply #5 on: January 11, 2013, 01:29:27 pm »
Whatever the implementation language, it boils down to listening on a port and handling messages, as indicated by Qwerty.55.
Nowadays, quite a number of people do rapid prototyping and development of advanced stuff with Node.js and WebSockets.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Sockets Server Side
« Reply #6 on: January 11, 2013, 06:31:21 pm »
Erm, but once you have the client data, you open a socket with the ip and the port to it, just as the client would?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!