Baoky A New Programer
Baoky A New Programer

Reputation: 187

C++ How do i check i got an active connection to certain site

C++ How do i check i got an active connection to certain site

Basically my mini project require connection to the site somesite.com

I want to upon launching my application, do a test to see if I can fetch data from somesite.com , if fetch.fail(), it will echo fail to establish connection to somesite.com

How can i do this.

Thanks for all the help !

Upvotes: 0

Views: 103

Answers (1)

inkooboo
inkooboo

Reputation: 2944

C++ have no networking support in standard library. So you should use so third-party library to do it. Or you can make it by means of OS function calls.

I think the simplest one is to use libcurl. There is example that you need.

Upvotes: 3

Related Questions