By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,842 Members | 2,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,842 IT Pros & Developers. It's quick & easy.

a library with sockets and files?

P: n/a
Tom
I want to stream objects to sockets and/or files.

wxWindows supports this, but I don't think it uses standard streams. I think it uses it's own.

Boost doesn't have system services I think.

What's the best option?

Thanks,
Tom.
Jul 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Heya Tom,

Tom wrote:
I want to stream objects to sockets and/or files.

wxWindows supports this, but I don't think it uses standard streams. I think it uses it's own.

Boost doesn't have system services I think.

What's the best option?


It's true that Boost doesn't yet have socket support - though they have
one in development. If you're curious have a look at the boost sandbox:

http://groups.yahoo.com/group/boost/files/socketstream/

Googling will find you many other socket libraries (a Sourceforge search
also brings up a couple of implementations). Choosing one will depend
on how complex your needs are and which platform you're developing on.

As for files - the standard C++ iostream library should do everything
you need shouldn't it?

Finally, if you need to manipulate files and directories (renaming,
moving, copying etc) boost also offers the filesystem library.

Cheers,
Matt

Jul 22 '05 #2

P: n/a
Tom
"Matt S Trentini" <ma*************@hotmail.com> wrote in message news:3f********@news.alphalink.com.au...
Heya Tom,

Tom wrote:
I want to stream objects to sockets and/or files.

wxWindows supports this, but I don't think it uses standard streams. I think it uses it's own.

Boost doesn't have system services I think.

What's the best option?


It's true that Boost doesn't yet have socket support - though they have
one in development. If you're curious have a look at the boost sandbox:

http://groups.yahoo.com/group/boost/files/socketstream/

Googling will find you many other socket libraries (a Sourceforge search
also brings up a couple of implementations). Choosing one will depend
on how complex your needs are and which platform you're developing on.

As for files - the standard C++ iostream library should do everything
you need shouldn't it?

Finally, if you need to manipulate files and directories (renaming,
moving, copying etc) boost also offers the filesystem library.

Cheers,
Matt


Thanks for the resonse Matt.

As for platform, I'm writing on Windows with VC6 and VC7.1, but I try to stick to stuff that will also run on Linux.

The only problem with Boost is that I've had some bad experiences. The few libraries I've tried (filesystem and something else) have caused my file size to increase quite a bit, and my compile time to go thru the roof, even with VC7.1. Boost should create a table that shows dependencies between libraries and that rates the different libraries for how much they use templates. I'm looking for stuff that uses templates only where necessary.

Is the boost socket library moderate in it's use of templates?

Tom.

Jul 22 '05 #3

P: n/a
Heya Tom,
As for platform, I'm writing on Windows with VC6 and VC7.1, but I try
to stick to stuff that will also run on Linux.

The only problem with Boost is that I've had some bad experiences.
The few libraries I've tried (filesystem and something else) have
caused my file size to increase quite a bit, and my compile time to
go thru the roof, even with VC7.1. Boost should create a table that
shows dependencies between libraries and that rates the different
libraries for how much they use templates. I'm looking for stuff
that uses templates only where necessary.

Is the boost socket library moderate in it's use of templates?


I haven't actually used that boost-sandbox socket library, I've just
been keenly watching it's development. Trawling through the code
reveals some template use but it doesn't look excessive. However, I
certainly haven't had your bad experiences with boost - my compile times
and file sizes have increased, but definitely not dramatically. Sorry
to hear that yours did (particularly with filesystem! There's hardly
any potential for template bloat there I would have thought...). I
would hate to develop without those libraries these days!

A table of dependencies would be useful - well, interesting more than
useful for me - perhaps you should suggest it in the boost newsgroup? :)

I'm not sure about the template rating. It would be difficult, and
fairly useless, to just provide a single figure which is meant to
represent the "template factor", especially given the varying platforms
that boost targets.

There is in fact a number of socket libraries in the boost sandbox -
take a squiz at http://groups.yahoo.com/group/boost/files. They vary
wildly in implementation (and template use) because they haven't reached
production maturity yet. But I've used a few boost sandbox libraries in
the past and have found some of them to be high quality code.

There is another socket library that I have used - it's comparatively
simple but effective. Written by Maciej Sobczak you can find it here:
http://www.msobczak.com/prog/downloads.html.

Cheers,
Matt

Jul 22 '05 #4

P: n/a
Tom
"Matt S Trentini" <ma*************@hotmail.com> wrote in message news:3f******@news.alphalink.com.au...
Heya Tom,
As for platform, I'm writing on Windows with VC6 and VC7.1, but I try
to stick to stuff that will also run on Linux.

The only problem with Boost is that I've had some bad experiences.
The few libraries I've tried (filesystem and something else) have
caused my file size to increase quite a bit, and my compile time to
go thru the roof, even with VC7.1. Boost should create a table that
shows dependencies between libraries and that rates the different
libraries for how much they use templates. I'm looking for stuff
that uses templates only where necessary.

Is the boost socket library moderate in it's use of templates?
I haven't actually used that boost-sandbox socket library, I've just
been keenly watching it's development. Trawling through the code
reveals some template use but it doesn't look excessive. However, I
certainly haven't had your bad experiences with boost - my compile times
and file sizes have increased, but definitely not dramatically. Sorry
to hear that yours did (particularly with filesystem! There's hardly
any potential for template bloat there I would have thought...). I
would hate to develop without those libraries these days!

A table of dependencies would be useful - well, interesting more than
useful for me - perhaps you should suggest it in the boost newsgroup? :)

I'm not sure about the template rating. It would be difficult, and
fairly useless, to just provide a single figure which is meant to
represent the "template factor", especially given the varying platforms
that boost targets.

There is in fact a number of socket libraries in the boost sandbox -
take a squiz at http://groups.yahoo.com/group/boost/files. They vary
wildly in implementation (and template use) because they haven't reached
production maturity yet. But I've used a few boost sandbox libraries in
the past and have found some of them to be high quality code.


Hey I didn't even know about the 'sandbox'. There's tons of stuff there! I thought that boost had gotten off of Yahoo Groups. It would be really great if someone started a site with all these libraries where people could comment on them. CodeProject is annoying for its focus on MFC and Windows, but otherwise it's great. Without something like CodeProject these boost libraries don't really get noticed (by me at least).

And, as you suggested, there are lots of socket (& stream) stuff there.

Regarding the problems I had with code size and compile time - I was quite surprised. I had expected problems on VC6 but not-so-much on VC7.1. My method wasn't exactly scientific, but I repeated it a few times carefully until I was fairly confident with my results. I was dissapointed because I had wanted to use the boost stuff.

Thanks,

Tom.
There is another socket library that I have used - it's comparatively
simple but effective. Written by Maciej Sobczak you can find it here:
http://www.msobczak.com/prog/downloads.html.

Cheers,
Matt

Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.