Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

When using blocking Sockets, why does Send throw an InvalidOperationException when blocking is set to false?

0
Posted

When using blocking Sockets, why does Send throw an InvalidOperationException when blocking is set to false?

0

Thereis a known issue with setting Blocking to false on a blocking socket.There are three paradigms when programming with sockets (both managedand native) and it is strongly recommended that developers useasynchronous I/O functions as a solution to this problem. Select isvery inefficient in managed code, and the cost of the regular caseexception is also high. The three paradigms are detailed below, withthe last being the preferred method.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.