I have such socket:
s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
Am I correct then when I call
s.Receive(byte[]);
I receive exactly one datagram? I need to process datagrams one by one.
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.
It will return at most one UDP packet. (If one consider that an Exception results in “not returning anything”.)
The Socket.Recieve documentation states (in the remarks section):
However, note the following sentence:
The call may also throw an Exception on a timeout or when there is no data available in non-blocking mode, etc.
Happy coding.