 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
om Guest
|
Posted: Sun Nov 20, 2005 5:05 pm Post subject: reading a stream coming from a http source |
|
|
I am new to c++ can anyone advice me how to read a stream coming from a
http source thanks.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Ben Hutchings Guest
|
Posted: Sat Dec 03, 2005 11:32 am Post subject: Re: reading a stream coming from a http source |
|
|
om <shaikhm3 (AT) cs (DOT) man.ac.uk> wrote:
| Quote: | I am new to c++ can anyone advice me how to read a stream coming from a
http source thanks.
|
There is no networking support in the C++ standard library. It is not
too difficult to define a streambuf that works with sockets, which
could then be used for HTTP; I was able to do so with about 50 lines
of code and the aid of a few socket wrapper functions. However, it
does require some knowledge of the socket API(s) and is probably not a
sensible task for a beginner. There are probably existing class
libraries that provide streams like this, though.
--
Ben Hutchings
Having problems with C++ templates? Your questions may be answered by
<http://womble.decadentplace.org.uk/c++/template-faq.html>.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Maciej Sobczak Guest
|
Posted: Mon Dec 05, 2005 12:28 pm Post subject: Re: reading a stream coming from a http source |
|
|
Ben Hutchings wrote:
| Quote: | There is no networking support in the C++ standard library. It is not
too difficult to define a streambuf that works with sockets, which
could then be used for HTTP; I was able to do so with about 50 lines
of code and the aid of a few socket wrapper functions. However, it
does require some knowledge of the socket API(s) and is probably not a
sensible task for a beginner. There are probably existing class
libraries that provide streams like this, though.
|
A lot of, actually.
For starters, you may wish to try this:
http://www.msobczak.com/prog/bin/sockets.zip
It is a basic and simple implementation of the TCP stream within the
IOStreams framework.
--
Maciej Sobczak : http://www.msobczak.com/
Programming : http://www.msobczak.com/prog/
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|