I have a program that recevice message in udp in visual studio.

sometime I miss a message.I want to use select to see udp buffer used size if udp rec buffer is full.

How I can use select for this purpose?

where can I see a example?
['https://Stackoverflow.com/questions/12803508', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/598470/']
Post-fact discovery that your receive buffer is full will not do you any good - packets have already been dropped. Even more - you need to set your buffer sizes before `connect()` or `bind()`, they will not change after that.

What you should do is pre-set socket receive buffer to some large value that would accommodate your traffic spikes, and try to process your network input faster. That usually means doing `select()` on non-blocking sockets (or even better - some advanced API like Linux `epoll(7)` in edge-triggered mode), and draining socket input until you get `EWOULDBLOCK`.

### Edit 0:

You cannot discover that you missed a UDP packet by using `select()` or any other socket API. This has to be done in the **application-level protocol**, i.e. one layer up from the transport. Common practice is including sequence numbers in application message header.
I think one of the main properties of UDP (as opposed to TCP) is that you will sometimes lose messages. You have to design your protocol to account for that. I'm not an expert in UDP, but I don't understand how seeing the size of the buffer will help you, and I don't understand why you want to use `select` to do it.