Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » Detect connection, valid URL, 404 page
Re: Detect connection, valid URL, 404 page [message #14301 is a reply to message #14268] Thu, 21 February 2008 22:58 Go to previous messageGo to previous message
zsolt is currently offline  zsolt
Messages: 702
Registered: December 2005
Location: Budapest, Hungary
Contributor
Engeor wrote on Thu, 21 February 2008 12:24

If I try to load a file that does not exists on the server then the http server returns 404 page. In this case HttpClient returns no error so I search returned buffer for 404 inside <TITLE> tag.

1) Is there any better way how to detect that file does not exists on the server?

Use GetStatusCode() to get HTTP status code.
Quote:


2) How to detect non-existing server? (Another way that wait for timeout).



On timeout, the result will be an empty string and you can use IsError() as well.
You can get error message calling GetError().
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Checking socket connection after send.
Next Topic: CPU_Cores() error
Goto Forum:
  


Current Time: Mon Jun 09 08:36:45 CEST 2025

Total time taken to generate the page: 0.04807 seconds