add code to connect comet with server;