Re: [boost] asio networking proposal

- Consistency with a future asynchronous version of the same function. As a rule, in async versions of the functions complex structures or buffers need to be passed as arguments, andthe only difference between the sync and async functions is the callback handler, i.e.:
void operation(parameters);
template <typename Handler> void async_operation(parameters, Handler handler);
Treating synchronous and asynchronous differently here seems less generic than always using template <typename Handler> void operation(parameters, Handler handler); Would it be bad to do it this way (possibly with a synchronous handler defaulted?)
Yes, I agree that read and write are better, because of the "portability" of the names to non-sockets that it gives. I've wanted to make that change for some time, but the thing that has been preventing me is what to call the datagram functions sendto and recvfrom, as writeto and readfrom don't seem quite right. Any suggestions?
I don't perceive what's wrong with "write_to" and "read_from". Dave P.S. I saw in another Boost posting a poster using email address sid@6581.com. It's nice to see that there's other C=64 oldtimers out there! ;-)

Hi Dave, --- Dave Gomboc <dave@cs.ualberta.ca> wrote:
Treating synchronous and asynchronous differently here seems less generic than always using
template <typename Handler> void operation(parameters, Handler handler);
Would it be bad to do it this way (possibly with a synchronous handler defaulted?)
Sorry, I wasn't really clear before. The presence or not of the handler parameter is the difference in the function *signatures*. How the function actually behaves is quite different (a synchronous call blocks the calling thread, an asynchronous call never blocks). It is not the handler parameter that determines whether the operation is synchronous or asynchronous; the handler is just the function that is called when the asynchronous operation completes.
I don't perceive what's wrong with "write_to" and "read_from".
What do you think of my proposal in my email earlier today where basically I use "read" and "write" for the operations that are in the *Stream concepts (and so could equally apply to pipes, files and so on), but retain "send" and "receive" (and "send_to" and "receive_from") for operations that are specific to sockets? Cheers, Chris

On Fri, 19 Aug 2005 23:33:36 -0600 (MDT), Dave Gomboc <dave@cs.ualberta.ca> wrote:
Yes, I agree that read and write are better, because of the "portability" of the names to non-sockets that it gives. I've wanted to make that change for some time, but the thing that has been preventing me is what to call the datagram functions sendto and recvfrom, as writeto and readfrom don't seem quite right. Any suggestions?
I don't perceive what's wrong with "write_to" and "read_from".
Dave
P.S. I saw in another Boost posting a poster using email address sid@6581.com. It's nice to see that there's other C=64 oldtimers out there! ;-)
Nice to see that someone recognizes my address. Most people ask what it means. :) www.6581.com might bring back some memories for you. (Works best in IE.) -- Be seeing you.
participants (3)
-
Christopher Kohlhoff
-
Dave Gomboc
-
Thore Karlsen