Server Socket in Windows Azure, how to capture External Ip?

Asked

Viewed 117 times

1

I developed an App Console, which creates an asynchronous Server Socket. A similar can be seen HERE.

I also have a common Web App, which consumes the information entered in the database by the App Console.

The need arose to upgrade these applications to Windows Azure. I searched the web and found the possibility to associate my App Console with my Web App. That way, by creating a Webjobs associated with my web project, the App Console would be started automatically with the web project and without the need for me to rewrite it. That solution is HERE

Well, it worked in parts. The App Console has run correctly and is running, but the IP the application uses for listening (Ipendpoint) is 127.0.0.1.

This was expected because it was using the same code from the sample for testing:

IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName());
IPAddress ipAddress = ipHostInfo.AddressList[0];
IPEndPoint localEndPoint = new IPEndPoint(ipAddress, Porta);

Consequently, when trying to send information to Server Socket, it does not exist!!

The big question is: - How to capture the External IP that Azure is using via the codeline in order to create Endpoint and associate it with Socket?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.