I have now read a total of 5 different winsock tutorials and I still do not get how sockets work! Could somebody please explain how to make a program that will allow n computers to share data with each other. As an example could somebody make a 'game' with the following rules:
- check for the existence of the server (Give it a unique name?)
- if it does not exist, create it, you are now the SERVER
- if it does exist, join it, you are now a CLIENT
- As a server, repeatedly send out "GAME" to each client
- As a client in responce send back a string
- As a server print all of the recieved strings that are in response to a "GAME" call (add some code to the start of the string?)
- As a server, if the string "EXIT" is recieved in response to a "GAME" call, shut down the socket after sending a string.
- On socket shutdown, print the exit string recieved by the server if you are a CLIENT.
I really need help, sockets are making no sense whatsoever to me. Thank you.