Boost logo

Boost Users :

Subject: [Boost-users] [Boost::asio] Problem using the same io_service with many sockets
From: María Victoria Rocha (victoria_at_[hidden])
Date: 2016-09-30 14:16:35

Hi all,

I have defined an io_service that is used by two sockets, one of them
uses tcp, and the other udp.

When the callback of this async_read_some is called

boost::bind(&RequestHandler::onRead, shared_from_this(),

A udp socket is created with the same io_service and an
async_receive_from is called. On the callback of this read operation I
try to write to the tcp socket but it captures an exception with
message: "unknown exception".

When this happens, the client that is listening to the tcp socket,
receives "End of file" error.

I resolved this problem with an io_service per socket but I would like
to use the same io_service.

Someone has any idea why this happens?



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at