lifeemotions / knx.net

KNX.net provides a KNX API for .NET
MIT License
101 stars 47 forks source link

Communication from Azure web app #69

Open franksandersen opened 2 years ago

franksandersen commented 2 years ago

I try to use KnxConnectionTunneling from Azure web app but I cannot connect to remote IP gateway. I get this error when calling Connect(): ConnectionErrorException: Error connecting to xx.xx.xx.xx:3671 The requested address is not valid in its context

Same web app is working fine from my PC (visual studio) connecting to remote IP gateway over VPN.

Is there anyone that can guide me about Azure web app networkig setup here? Anyone who got this knx.net package working from an Azure web app?

My relevant code:

var localIP = Dns.GetHostEntry("mysite.azurewebsites.net").AddressList.Where(x => x.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork).First().ToString();
var connection = new KnxConnectionTunneling([RemoteKnxGatewayIp], 3671, localIP, 3671);
connection.Connect() -> this line fails with error above