Omnimaga

General Discussion => Computer Programming => Technology and Development => C and C++ => Topic started by: Sorunome on January 10, 2013, 10:34:27 pm

Title: Sockets Server Side
Post by: Sorunome 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
Title: Re: Sockets Server Side
Post by: pimathbrainiac 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)
Title: Re: Sockets Server Side
Post by: Sorunome 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.
Title: Re: Sockets Server Side
Post by: pimathbrainiac on January 11, 2013, 12:44:59 pm
What is it??? A MOBA, MMO, Online Multiplayer thingymabob?
Title: Re: Sockets Server Side
Post by: AngelFish 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.
Title: Re: Sockets Server Side
Post by: Lionel Debroux 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.
Title: Re: Sockets Server Side
Post by: Sorunome 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?