select ethernet card for socket?

how can i select an specific ethernet card for a socket, when i have multiple ethernet-cards (lan, wireless) installed? i have two cards, configured for two different subnets: wireless: 192.168.50.x lan: 2.1.1.x and want to open a socket and broadcast to 2.1.1.x but without touching the wireless-settings. currently, i