C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 07-02-2009, 07:44 PM   #1
Registered User
 
Join Date: Jun 2009
Posts: 44
Connecting to servers (sockets?)

How, in C++, do you get files from something like a standard http server? Say I'm trying to get the file from downloads.example.org/package.tar.gz .
I assume you can do that, all I've managed to read so far suggests the server needs to be specially set up.

Last edited by Muscovy; 07-02-2009 at 07:46 PM. Reason: grammer error.
Muscovy is offline   Reply With Quote
Old 07-03-2009, 04:33 PM   #2
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,629
I'd imagine you'd establish a connection to the standard HTTP port (80) and then send an HTTP request. I don't know the format for that, but you can probably find it online.

BTW, you could use the program wget to simplify this, because it will do all the HTTP work for you, and you can just execute "wget http://google.ca/".

[edit] And the server is specially set up. It has to be running the HTTP daemon. [/edit]
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, etc.

New project: nort
dwks is offline   Reply With Quote
Old 07-03-2009, 05:09 PM   #3
Registered User
 
Join Date: Jun 2009
Posts: 44
By 'the http daemon', do you mean the sort of thing that is essentially any http server?
What I want to know is if servers I connect to need to be Linux friendly or simmilar.
Muscovy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
inet_aton()... Noob needs help with sockets :| Maz C++ Programming 3 11-22-2005 04:33 PM
Raw Sockets and SP2... Devil Panther Networking/Device Communication 11 08-12-2005 04:52 AM
Asynchronous sockets dpro Networking/Device Communication 4 12-20-2004 06:53 PM
Connecting to servers ect Seph_31 Networking/Device Communication 4 12-02-2003 08:25 AM
Starting window sockets _Cl0wn_ Windows Programming 2 01-20-2003 11:49 AM


All times are GMT -6. The time now is 03:32 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22