Well that's a stupid way to handle it... keep the socket open... read about Comet. http://en.wikipedia.org/wiki/Comet_(programming)
It's a shame people seem to have started saying "use comet" without understanding what it means. Did you read that link?