Recently, I learned about UDP juice while browsing the network, and all the pages explaining this mention that UDP sockets are “less connected”. This, if I understand correctly, means that one does not have a “connection” between the two sockets, but instead it sends datagram packets to the specified endpoints, not knowing if it is listening to the other end.
Then I go and start reading boost :: asio :: ip :: udp :: socket docs and find that it mentions the API as
- async_connect: run asynchronous connect .
- async_receive: start asynchronous reception on a connected socket .
- async_send: start asynchronous sending on the connected socket .
Now this is a bit confusing for beginners. I can find 3 possible reasons for my confusion (in order of similarity :))
- I'm missing something
- The asio implementation does something behind the scenes to virtualize the connection.
- Incorrect documentation
There is a slight glitch in the documents when you open the page for basic_datagram_socket :: async_connect in the example there is a TCP instance (instead of UDP ).
Will someone please enlighten me?
source share