enzis
02-09-2012, 05:27 PM
Hi guys! I've been doing some research on how to go about doing a web-based chat application. I see that to do it right, it should be socket based, and that sockets are a php thing. Thus, it makes sense conceptually how it should work on the servers end, since the server is suppose to build a socket and constantly run, listening to some port.
What I don't understand is how to make this thing work on the client side. Since sockets are a php thing, I have to reload the page. Of course, this can be cheated a bit using javascripts XMLhttpResponse() function, but then I have to set an interval to make it check every 1 second or something. What I really want to know, is how to do this the "right" way, and how to make it so it's instantaneous; not interval-based. I've heard of people using flash. Currently, I only know html, php, and javascript, but am willing to learn more if I'm suppose to.
Thanks in advance for any ideas.
What I don't understand is how to make this thing work on the client side. Since sockets are a php thing, I have to reload the page. Of course, this can be cheated a bit using javascripts XMLhttpResponse() function, but then I have to set an interval to make it check every 1 second or something. What I really want to know, is how to do this the "right" way, and how to make it so it's instantaneous; not interval-based. I've heard of people using flash. Currently, I only know html, php, and javascript, but am willing to learn more if I'm suppose to.
Thanks in advance for any ideas.