Relative Content

Tag Archive for c#.netwindowssocketsudp

How to use IOControlCode.BindToInterface in my socket in .NET?

I’m trying to bind a socket in .NET to a specific network interface. Looking at the IOControlCode documentation, I can see that I could use BindToInterface (SIO_INDEX_BIND) or UnicastInterface (SIO_UCAST_IF) paired with the IOControl method for that. However, when I try using any of those options, I get the following exception: