 			socket = new Socket();
 			socket.addEventListener(Event.CLOSE, socketClosed);
 			socket.addEventListener(Event.CONNECT, socketConnected);
-			socket.addEventListener(IOErrorEvent.IO_ERROR, onSecurityError);
+			socket.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
 			socket.addEventListener(ProgressEvent.SOCKET_DATA, socketDataReceived);
 			socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
 		}


		/**
		 * Sends empty data in order to keep the connection alive.
		 */
		public function sendKeepAlive():void
		{
			if ( isActive() )
			{
				sendXML("< />"); // String
			}
		}


	{
		/**
		 * Stream type lets user set opening/closing tag.
		 * <code>&lt;stream:stream&gt;</code>
		 */
		public static const STREAM_TYPE_STANDARD:uint = 0;
		/**
		 * Stream type lets user set opening/closing tag.
		 * <code>&lt;stream:stream /&gt;</code>
		 */
		public static const STREAM_TYPE_STANDARD_TERMINATED:uint = 1;
		/**
		 * Stream type lets user set opening/closing tag.
		 * <code>&lt;flash:stream&gt;</code>
		 */
		public static const STREAM_TYPE_FLASH:uint = 2;
		/**
		 * Stream type lets user set opening/closing tag.
		 * <code>&lt;flash:stream /&gt;</code>
		 */
		public static const STREAM_TYPE_FLASH_TERMINATED:uint = 3;
		
