+  Scratch Projects Forum
|-+  Programmers Corner» C++» Programming an HTML Downloader in C++
Username:
Password:
Pages: [1]
  Print  
Author Topic: Programming an HTML Downloader in C++  (Read 4921 times)
Scratch Projects
Administrator
novice coder
*****

Karma: +0/-0
Posts: 56


View Profile
« on: September 25, 2006, 05:58:27 PM »

This program requests the source code (HTML) of a webpage and then gives the user multiple options for viewing the web server's response. We will use the Winsock API to manipulate sockets on the system, and create reusable code along the way.

Read the full article here: http://www.scratchprojects.com/2006/09/html_downloader_p01.php
Logged
xsuperloadx
n00b
*

Karma: +0/-0
Posts: 2


View Profile
« Reply #1 on: August 20, 2007, 12:09:12 PM »

I have a problem with this program :(

It don't work.
Problem is in "connect" function, always return SOCKET_ERROR.
I don't know what to do now..
Logged
Kevin
Administrator
31337
*****

Karma: +1/-0
Posts: 137


View Profile WWW
« Reply #2 on: August 20, 2007, 05:02:25 PM »

I haven't messes with C++ in a while, so I'll contact the author of the tutorial and see if he's got a solution for you.
Logged

MalachiX
n00b
*

Karma: +0/-0
Posts: 1


View Profile
« Reply #3 on: August 23, 2007, 03:30:26 AM »

Hi, I'm the author.  Sorry i didn't reply sooner.  If you were unable to use the program then my initial assumption would be that the program is being blocked.  The program could be blocked because that port is already open.  I suggest changing the "intLocalPort" variable in the GetWebpage function.  You can change it to any random port it shouldn't matter.

If your still having the same problem then turn fof any firewalls that your have.

If after that you still have problems then let me know what error number your receiving.  I designed the program so that if an error occurs it terminates by throwing a runtime error.  So if you run the program from a command prompt then there should be an error number left in the command prompt when the program ends.  The cause for the error can be looekd up on Microsoft's MSDN website at: http://msdn2.microsoft.com/en-us/library/ms740668.aspx.

Lastly, if you still have problems and need any help you can contact me.  My AIM screenname is "MalachiX18".

P.S.  Let us know how it goes.
« Last Edit: August 30, 2007, 10:23:35 PM by MalachiX » Logged
xsuperloadx
n00b
*

Karma: +0/-0
Posts: 2


View Profile
« Reply #4 on: September 12, 2007, 05:19:09 PM »

Sorry for long respond..
Firewall is turned off, random port and it still don't work.
error number is 10060 (timeout)
so it won't work.. however I don't need it anymore, I've used PHP+Curl for my program and it now work :)

And thanks for replies.
« Last Edit: September 12, 2007, 05:21:14 PM by xsuperloadx » Logged
Pages: [1]
  Print  
 
Jump to: