Jump to content

Is it possible to set the browser to listen for socket connections?


JamesB

Recommended Posts

HeyI was wondering is it possible to set the browser to listen for socket connections? It doesn't have to be in javascript.I was thinking about making something like a chat room, and for example when someone joins the chatroom, the server could connect to the browser using a socket then send a simple packet which javascript or another language could then handle.Thanks,James

Link to comment
Share on other sites

I built a chat room using AJAX and PHP. The client browser logs on and polls the server at a set interval. (I think I used 4 secs.) The server responds with a byte of "something" to indicate nothing new, or with an HTML snippet containing the text of any new messages. The beauty of AJAX is you can exchange only as much data as you need, not a whole document. Roughly corresponding to your "simple packet" idea.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...