Jump to content
Posted 28 November 2011 - 11:35 PM
Posted 29 November 2011 - 12:13 AM
Professional Programmer & Hobbyist Game Developer
Posted 29 November 2011 - 02:34 AM
Posted 29 November 2011 - 08:39 AM
Posted 29 November 2011 - 09:38 AM
Correct, that sums it up nicely.
I am actually using c++ for my server side app, but was using C for the sockets. Looks like with the libraries you posted, I can just use the listen() function and, within a loop, use the accept() call to accept all the new requests? Then I would create a client structure of some sort that had the socket and other necessary client info? If so, sounds easy enough.
Posted 29 November 2011 - 01:15 PM
It's actually easier in my opinion. Simply put you create a listener socket and use that to handle incoming connection requests. Then you create a new socket for each individual connection. From there using the simple API's feeding in the socket (which is just an integral ID) you "talk" to each one directly. Running a simple google search for c socket tutorial will be your best start. However I highly recommend using the newer C++ technologies as they are just more stable and provide some more reliable power for high powered servers. Here is an excellent tutorial example to get you started with a C++ socket server on linux.