Only call onopen after we have ensured that the connection has actually been opened. Firefox likes to do readystatechange events (0->2) when reconnecting fails but these attempts have status==0 and should not trigger onopen.