I need an advice with the situation
I'm doing a udp async multicast transiver :
Data is sent in the following cases:
I use one socket for receive and send . Do I need synchronize async_receive_from and async_send_to from external timer? booast::asio doc says that objects are unsafe. My solution is use a ioserivce post/dispatch for external timer data, that async_send_to call in the same thread
If I make two sockets - one for read, one for thread, who works this one multicast groud. Do I need synchronize this?
PS I'm using one thread ioservice::run
As soon as an external timer is involved likely a strand is required for synchronization. The only exception is when the service is restricted to a single thread already - and the "external timer" trigger originates from that same thread. This is called the implicit strand.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.