 		{
 			ignoreWhitespace = val;
 		}
+		
+		private function _createXmlSocket():XMLSocket {
+			var socket:XMLSocket = new XMLSocket(server, port);
+			socket.addEventListener(Event.CONNECT,socketConnected);
+			socket.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
+			socket.addEventListener(Event.CLOSE,socketClosed);
+			socket.addEventListener(DataEvent.DATA,socketReceivedData);
+			socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityError);
+			return socket;
+		}
 	}
 }

			
			// Cancel everything by closing connection
			try {
				socket.close();
			}
			catch (error:Error){
				

		 * @private
		 */
		protected function securityError(event:SecurityErrorEvent):void{
			trace("there was a security error of type: " + event.type + "\nError: " + event.text);
			dispatchError( "not-authorized", "Not Authorized", "auth", 401 );
		}
