Wie kann man mehrere Netzwerkschnittstellen (eth0, eth1, ...) unter Python unterscheiden, bzw. ansprechen.
Wie geht das, wenn BaseHTTPServer verwendet wird?
Wie geht das mit Socket?
Mehrere Netzwerkschnittstellen ansprechen
Code: Alles auswählen
In [4]: help(socket.socket.bind)
bind(self, *args) unbound socket._socketobject method
bind(address)
Bind the socket to a local address. For IP sockets, the address is a
pair (host, port); the host must refer to the local host. For raw packet
sockets the address is a tuple (ifname, proto [,pkttype [,hatype]])
Sorry, das versteh ich so nicht. (mangels meiner Erfahrung).SchneiderWeisse hat geschrieben:Soweit ich weiß, kann man alle interfaces einfach mit None oder "" ansprechen.Code: Alles auswählen
In [4]: help(socket.socket.bind) bind(self, *args) unbound socket._socketobject method bind(address) Bind the socket to a local address. For IP sockets, the address is a pair (host, port); the host must refer to the local host. For raw packet sockets the address is a tuple (ifname, proto [,pkttype [,hatype]])
Ist für mich zu theoretisch.
Wäre ein Stückchen Code, event. mit eth0/eth1 möglich.
Danke.