views:

1141

answers:

1

Hey folks,

I have created server daemon, that produces some data, like messages and so. But, what im interested in - client monitoring. For example i have web page, and i need to establish persistent Tcp connection to server and show all incoming data into textbox. I know it can be done with flash, but im searching for JS implementation.

Is it possible and what`s the best practices ?

+3  A: 

What you're asking for is known as Comet. Plenty of server software and client libraries exist - see the linked Wikipedia page.

RichieHindle
so, for example Facebook chat client uses same technology ?
Dan Sosedoff
Not necessarily - a web chat can be created using a simple polling technique, where JavaScript simply makes a request to the server for new messages every few seconds. Granted, not a great approach, but it works.
Jason Bunting
Yeah, i found this approach matching my needs after analyzing facebook`s chat system. It`s kinda private messages, but accessible on fly.
Dan Sosedoff