can you set SO_RCVTIMEO and SO_SNDTIMEO socket options in boost asio?
If so how?
Note I know you can use timers instead, but I’d like to know about these socket options in particular.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Absolutely! Boost ASIO allows you to access the native/underlying data, which in this case is the SOCKET itself. So, let’s say you have:
And let’s say you’ve already called
openorbindor some member function that actually makesmy_socketusable. Then, to get the underlying SOCKET value, call:So there you have it! Boost’s ASIO lets you do many things more quickly than you otherwise might be able to, but there are a lot of things you still need the normal socket library calls for. This happens to be one of them.