How to set up a Winsock UDP socket?

前端 未结 4 1525
花落未央
花落未央 2021-02-02 14:21

I want to create a Winsock UDP socket that only sends data to a client. I want the kernel to choose an available port for me. On the other hand, I want to indicate which local I

4条回答
  •  死守一世寂寞
    2021-02-02 14:49

    Not a direct "HowTo", but I have been using an open source library called "ACE (Adaptive Communication Environment" for all my TCP and UDP socket programming and found it very useful and powerful. It takes a "software pattens" approach to providing building blocks to solve your particular problem. I was able to use their UDP encapsulation to connect to a given port and have replies sent to a free port chosen by the system. Alternatively you can specify the return port if you wish. ACE is available here: ACE Homepage

提交回复
热议问题