Plugin python - Connection function

Python and python framework

Moderator: leecollings

Post Reply
pipiche
Posts: 2034
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Plugin python - Connection function

Post by pipiche »

from the documentation of the python framework, the API Connection() should allow to bind on a specific IP and Port, however whatever IP I'm using I'm always get bound to 0.0.0.0

the call:

Code: Select all

        self.httpServerConn = Domoticz.Connection(
            Name="Zigate Server Connection", 
            Transport="TCP/IP", 
            Protocol="HTTP",
            Address="127.0.0.1",
            Port="9441"
        )

if we print self.httpServerConn, we got the right information
"Name: 'Zigate Server Connection', Transport: 'TCP/IP', Protocol: 'HTTP', Address: '127.0.0.1', Port: '9441', Baud: -1, Timeout: 0, Connected: False, Parent: 'None'"

but if you do netstat to see the binding, this doesn't match the expectations

Code: Select all

~/dev-domoticz/plugins (development *=)$ sudo netstat -plutn | grep 9441
tcp 0 0 0.0.0.0:9441 0.0.0.0:* LISTEN 21268/domoticz
pipiche
Posts: 2034
Joined: Monday 02 April 2018 20:33
Target OS: Linux
Domoticz version:
Contact:

Re: Plugin python - Connection function

Post by pipiche »

any id, how we can bind to a specific IP:port instead of 0.0.0.0:port ?
Post Reply