      */
     public function openStreamingConnection(appendToURL:String=null):void
     {
+        state = INIT_STATE;
         _appendToURL = appendToURL;
         
     	// Construct the streaming connection if needed.

                    if (chunkBuffer.bytesAvailable == 0)
                        break;
                }
            }
        }
    }

                            {
							    channel.dispatchEvent(MessageEvent.createEvent(MessageEvent.MESSAGE, message));
                            }
                            // We've just finsihed the one point in the parse loop where we step outside of local control.
                            // The connection may now be closed, so check for this case here.
                            if (state == CLOSED_STATE)
                                return;
                            
                        }
						state = RESET_BUFFER_STATE;
                    }
