Posted: Tue Aug 10, 2010 6:05 pm Post subject: Question on WinSock
My question may seem hard to understand but please bare with me. If I were to go by making lets say, a chatting room which is available to anyone, would I connect EACH user who wants to chat in the room to my IP / SERVER which I am hosting? Then from there, every message that is sent is received by the server and sent back to each and every single user connected? How would I go by making a simple message a user enters sent to each user?
Joined: 25 Jan 2006 Posts: 8580 Location: 127.0.0.1
Posted: Tue Aug 10, 2010 6:13 pm Post subject:
If you don't connect them to the server, where else do you think the connection is going to go to?
Not every message is sent back to everyone. That part is up to you how the server is designed to interact with the clients. Such as connection/disconnection packets, keep-alive packets, chat packets, administrative commands and so on. You would only need to send back what you feel the server should send to everyone.
Someone logs in, you may want to inform everyone of it so you could send back a 'system' message saying said user logged in (or out).
Someone sends a message to everyone in the channel, you would want to send that back to everyone.
Someone sends a pm to someone, you wouldn't want everyone to receive the pm. You would only send it to the person getting the pm. _________________
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum