c++ - Do I have to bind an UDP socket in my client program, to receive data? (I always get WASEINVAL

c++ - Do I have to bind an UDP socket in my client program, to receive data? (I always get WASEINVAL

瀏覽:363
日期:2025-04-30
With UDP, you have to bind() the socket in the client because UDP is connectionless, so there is no other way for the stack to know which program to deliver datagrams to for a particular port. If you could recvfrom() without bind(), you'd essentially be a...看更多