본문 바로가기

프로그래밍

What is Comet?

Define: A server framework. Json published/Subscribe

Ajax Poll vs. Ajax Push
 - Poll : to get data from server(client request)
 - Push : spread data to client(Server spread)
...based on comet
Gmail, Gtalk and so on..

How Push works
 - Always Keep a Connection open
 
Technology Solutions
Java NIO
 - Non-blocking sockets
 - Threads shared among connection

How to use
1. initialize Comet(Object)
2. Define CometHandler(Event)
3. Register CometHandler(Registration : attached on context)
4. Advertise Changes
   1) Post called by one client
   2) clientside
   3) serverside

It's very useful framework, Comet server is necessary to service like a messenger or mail it works like a mirror
e.g. It notice you when you're received mail