简体   繁体   中英

Calling recvfrom() and setsockopt() to add/leave multicast membership from different threads

I have one thread calling recvfrom() and another thread calling setsockopt() to add/leave multicast membership. Is that thread safe or both functions need to be called from the same thread?

These are both system calls, not library functions, so it is safe to call them from different threads.

Whether a join/leave will affect a concurrent recvfrom() that has already started is a moot question.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM