when I use recv from windows sockets does using recv can lead to denial of service attack ?
If it waits for data forever? So what is the best way for solving this (alarms ?)
Thanks & Regards,
Mousey.
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.
You seem to mis-understand what denial of service means. An example would be a large number of HTTP requests to a single web-server arriving at such a rate that the web-server software becomes so busy it cannot accept new TCP connections. Wikipedia has a decent article on DoS, read it.
recv(2)is just an API. Misuse of it, as any other bug, can lead to issues, including DoS. But that does not mean you should avoid it. If your problem is blocking other sockets while waiting on a read, look into non-blocking sockets and I/O multiplexing as inselect(2),poll(2), andepoll(4).