How bind socket to device in windows?

馋奶兔 提交于 2019-12-06 07:27:53

问题


I have same network cards in computer. All cards has identical IP. I need to bind socket to specific card. In linux I can use flag SO_BINDTODEVICE. How I can do this in windows.

P.S. This needed for UDP sockets.


回答1:


I answered a similar question here: Using a specific network interface for a socket in windows

AFIK: in Windows XP and Windows Server 2003 IP4 I believe you can't, but for IP6 you can. And for Windows Vista and Windows 2008 you can (except for certain circumstances).

Hope that helps



来源:https://stackoverflow.com/questions/1951578/how-bind-socket-to-device-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!