Greetings.
I'm well familiarized with PHP, but I've never tried anything with sockets (I haven't needed so far). So...
I've challenged myself to develop a webchat. If I understood the whole socket concept, it is the correct way to do it, right? I mean, I could make a very nasty code that would make possible to people to chat having their browsers as an interface, but the way to do it IS with sockets, right? (oh, God, I'm starting to mumble :rolleyes: )
Well, considering I'm right on this little concept, I'd appreciate if you guys could point me some directions (I'm not asking for ready-to-go codes, remember, I want to learn):
1) Do I have to make a fsockopen for each user that enters the chat?
2) If I do that, how can I make everybody see the same stream?
3) Now, some code: Do I read from the socket by using fgets?? Again if the answer is yes, how do I know wich socket to read if each users has its own?
As you can see, I'm pretty much in the dark here, so if you guys could gently assist me, I'd be very gratefull.
Best regards,