a library with sockets and files?

T

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.
 
M

Matt S Trentini

Heya 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?

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
 
T

Tom

Matt S Trentini said:
Heya Tom,


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.
 
M

Matt S Trentini

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
 
T

Tom

Matt S Trentini said:
Heya Tom,


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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,147
Messages
2,570,837
Members
47,385
Latest member
Joneswilliam01

Latest Threads

Top