@@ -313,13 +313,20 @@ class seq_packet_socket_service
313
313
314
314
// / Start an asynchronous send.
315
315
template <typename ConstBufferSequence, typename WriteHandler>
316
- void async_send (implementation_type& impl,
316
+ ASIO_INITFN_RESULT_TYPE (WriteHandler,
317
+ void (asio::error_code, std::size_t ))
318
+ async_send(implementation_type& impl,
317
319
const ConstBufferSequence& buffers,
318
320
socket_base::message_flags flags,
319
321
ASIO_MOVE_ARG (WriteHandler) handler)
320
322
{
321
- service_impl_.async_send (impl, buffers, flags,
323
+ detail::async_result_init<
324
+ WriteHandler, void (asio::error_code, std::size_t )> init (
322
325
ASIO_MOVE_CAST (WriteHandler)(handler));
326
+
327
+ service_impl_.async_send (impl, buffers, flags, init.handler );
328
+
329
+ return init.result .get ();
323
330
}
324
331
325
332
// / Receive some data from the peer.
@@ -334,13 +341,21 @@ class seq_packet_socket_service
334
341
335
342
// / Start an asynchronous receive.
336
343
template <typename MutableBufferSequence, typename ReadHandler>
337
- void async_receive (implementation_type& impl,
344
+ ASIO_INITFN_RESULT_TYPE (ReadHandler,
345
+ void (asio::error_code, std::size_t ))
346
+ async_receive(implementation_type& impl,
338
347
const MutableBufferSequence& buffers, socket_base::message_flags in_flags,
339
348
socket_base::message_flags& out_flags,
340
349
ASIO_MOVE_ARG (ReadHandler) handler)
341
350
{
342
- service_impl_.async_receive_with_flags (impl, buffers, in_flags,
343
- out_flags, ASIO_MOVE_CAST (ReadHandler)(handler));
351
+ detail::async_result_init<
352
+ ReadHandler, void (asio::error_code, std::size_t )> init (
353
+ ASIO_MOVE_CAST (ReadHandler)(handler));
354
+
355
+ service_impl_.async_receive_with_flags (impl,
356
+ buffers, in_flags, out_flags, init.handler );
357
+
358
+ return init.result .get ();
344
359
}
345
360
346
361
private:
0 commit comments