Can Python select what network adapter when opening a socket?

前端 未结 3 1419
天命终不由人
天命终不由人 2020-11-30 07:28

The target machine running the python application will have three network interfaces available to it. In general all three networks will be vastly different, however there

3条回答
  •  無奈伤痛
    2020-11-30 08:32

    SO_BINDTODEVICE sounds reasonable, but normally you'll indirectly select a device by what IP address you bind to. More often than that, you'll just bind to '', to bind to all address of the machine.

提交回复
热议问题