private function getResponse($fh,$timeout = 5,$index = 0)
	{
		$read = array($fh);
		$write  = NULL;
		$except = NULL;
		$num_changed_streams = stream_select($read, $write, $except, 0);

		if ($num_changed_streams > 0) {
			$errorResponse = fread($fh, 6);
			$reason = '';
			if ($errorResponse) {
				// response is binary, we have to unpack it into an array
				$response = unpack('Ccommand/Cstatus_code/Nidentifier',$errorResponse);
				$code = array_key_exists('status_code', $response) ? $response['status_code'] : 255;
				$reason = array_key_exists($code, self::$ERRORS) ? self::$ERRORS[$code] : "Code $code";
			}
			return $reason;
		}
		
		// 10th time through, we give up
		if ($index >= ($timeout * 10)) return '';
		
		usleep(100000);
		return $this->getResponse($fh,$timeout,$index+1);
	}