JamesB Posted July 18, 2008 Share Posted July 18, 2008 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 More sharing options...
Ingolme Posted July 18, 2008 Share Posted July 18, 2008 Flash and Java can do that, but the browser alone can't do such a thing. Link to comment Share on other sites More sharing options...
jeffman Posted July 18, 2008 Share Posted July 18, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.