Re: [Boost-users] Transferring files across a network.
To all those who helped, especially Rahul who very kindly made some sample code available and put me on the right track. I now have a client and a server that can handle multiple files being sent over the network. The files are attached for your interest. If anyone can improve them I really will welcome their comments. If there is a need, it is Ok to include them as examples in the ASIO documentation. I have no issues with this. Thanks once again to everyone who helped. Regards Andrew
I now have a client and a server that can handle multiple files being sent over the network. The files are attached for your interest. If anyone can improve them I really will welcome their comments.
If there is a need, it is Ok to include them as examples in the ASIO documentation. I have no issues with this.
I mentioned this before, but here goes again - the following: sizeof(buffer_) should be: buffer_.size() Alignment or padding on some compilers might cause sizeof(buffer_) to be incorrect (different than buffer_size(), although it's probably rare). Cliff
Thanks for that I forgot about it!
Andrew
On Sun, Feb 1, 2009 at 11:06 AM, Cliff Green
I now have a client and a server that can handle multiple files being sent over the network. The files are attached for your interest. If anyone can improve them I really will welcome their comments.
If there is a need, it is Ok to include them as examples in the ASIO documentation. I have no issues with this.
I mentioned this before, but here goes again - the following:
sizeof(buffer_)
should be:
buffer_.size()
Alignment or padding on some compilers might cause sizeof(buffer_) to be incorrect (different than buffer_size(), although it's probably rare).
Cliff
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- ___________________________________________ Andrew J. P. Maclean Centre for Autonomous Systems The Rose Street Building J04 The University of Sydney 2006 NSW AUSTRALIA Ph: +61 2 9351 3283 Fax: +61 2 9351 7474 URL: http://www.acfr.usyd.edu.au/ ___________________________________________
From: "Andrew Maclean"
Thanks for that I forgot about it!
No problem! It might be that every commonly used C++ compiler has
sizeof(boost::array
I have just modified the code so it directly reads from the file and
writes to the file instead of into an iostream object. Much faster.
So if someone is adding examples to the ASIO docs, I wil be glad to
send them the examples.
Regards
Andrew
On Mon, Feb 2, 2009 at 5:03 AM, Cliff Green
From: "Andrew Maclean"
Thanks for that I forgot about it!
No problem! It might be that every commonly used C++ compiler has sizeof(boost::array
) == sizeof(char[N]), but unless there's a guarantee I'm missing, I could see an odd compiler that pads or aligns in some strange fashion, causing rare and hard-to-diagnose errors. Definitely you're good with (boost::array ).size() == sizeof(char[N]). Thanks for the example code - it would be good to add it (and others) to the Asio docs.
Speaking of which, I know Chris K has been busy (or in poor health?) and mostly unavailable for a while - I wonder if he wouldn't mind granting someone edit access to the Asio source for documentation purposes (or minor bug fixes). There's been a wealth of knowledge shared through the Boost and Asio mail lists, such as serial IO examples and run / poll / work service explanations.
Cliff
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- ___________________________________________ Andrew J. P. Maclean Centre for Autonomous Systems The Rose Street Building J04 The University of Sydney 2006 NSW AUSTRALIA Ph: +61 2 9351 3283 Fax: +61 2 9351 7474 URL: http://www.acfr.usyd.edu.au/ ___________________________________________
Can u send me the example just for viewing.
________________________________
From: Andrew Maclean
From: "Andrew Maclean"
Thanks for that I forgot about it!
No problem! It might be that every commonly used C++ compiler has sizeof(boost::array
) == sizeof(char[N]), but unless there's a guarantee I'm missing, I could see an odd compiler that pads or aligns in some strange fashion, causing rare and hard-to-diagnose errors. Definitely you're good with (boost::array ).size() == sizeof(char[N]). Thanks for the example code - it would be good to add it (and others) to the Asio docs.
Speaking of which, I know Chris K has been busy (or in poor health?) and mostly unavailable for a while - I wonder if he wouldn't mind granting someone edit access to the Asio source for documentation purposes (or minor bug fixes). There's been a wealth of knowledge shared through the Boost and Asio mail lists, such as serial IO examples and run / poll / work service explanations.
Cliff
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- ___________________________________________ Andrew J. P. Maclean Centre for Autonomous Systems The Rose Street Building J04 The University of Sydney 2006 NSW AUSTRALIA Ph: +61 2 9351 3283 Fax: +61 2 9351 7474 URL: http://www.acfr.usyd.edu.au/ ___________________________________________ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
Yes, I am agree with your suggestion. Asio documentation should be updated. Several users are having good examples that can be added to documentation.
-Rahul
________________________________
From: Cliff Green
Thanks for that I forgot about it!
No problem! It might be that every commonly used C++ compiler has sizeof(boost::array
Here are the examples.
I have tested them in Linux (debian, gcc-4.3.2) and Windows Vista
(Visual Studio 2008) using the latest boost version.
Feel free to use them. If you have any improvements, please let me
know and feed back a copy to me. As I have said, I am new at this.
I think it is an important and useful example. However I may be biased.
Andrew
On Tue, Feb 3, 2009 at 3:42 PM, master master
Yes, I am agree with your suggestion. Asio documentation should be updated. Several users are having good examples that can be added to documentation.
-Rahul
________________________________ From: Cliff Green
To: boost-users@lists.boost.org Sent: Sunday, 1 February, 2009 11:33:51 PM Subject: Re: [Boost-users] Transferring files across a network. From: "Andrew Maclean"
Thanks for that I forgot about it!
No problem! It might be that every commonly used C++ compiler has sizeof(boost::array
) == sizeof(char[N]), but unless there's a guarantee I'm missing, I could see an odd compiler that pads or aligns in some strange fashion, causing rare and hard-to-diagnose errors. Definitely you're good with (boost::array ).size() == sizeof(char[N]). Thanks for the example code - it would be good to add it (and others) to the Asio docs.
Speaking of which, I know Chris K has been busy (or in poor health?) and mostly unavailable for a while - I wonder if he wouldn't mind granting someone edit access to the Asio source for documentation purposes (or minor bug fixes). There's been a wealth of knowledge shared through the Boost and Asio mail lists, such as serial IO examples and run / poll / work service explanations.
Cliff
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
________________________________ Check out the all-new Messenger 9.0! Click here. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- ___________________________________________ Andrew J. P. Maclean Centre for Autonomous Systems The Rose Street Building J04 The University of Sydney 2006 NSW AUSTRALIA Ph: +61 2 9351 3283 Fax: +61 2 9351 7474 URL: http://www.acfr.usyd.edu.au/ ___________________________________________
participants (3)
-
Andrew Maclean
-
Cliff Green
-
master master