Search code examples
c#azuretcpworker

Azure - Basic App Comunication c# vs 2012


I have to write an application with azure in c# that:

has a worker role comparing gps information stores user profile information

and can get and set both of these from user device.

for example what i want is for my device to periodically upload its gps co-ordinates to the worker by opening a connection with the worker role, authenticate the user, allow saving the gps co -ordibates over any existing co-ordinates for this user. Also or as a separate worker i don't know, i need the worker role to be checking and performing calculations on the gps' of all devices. Which at certain points would then push the some information down to a particular device.

What i want doesnt seem difficult but finding just a simple example of a tcp message from a device to an azure service ive spent hours looking its the comunications between devices that im not understanding


Solution

  • TCP programming with Azure is possible, but not practical if you need the TCP endpoint available at all times. A TCP endpoint cannot remain inactive for long periods of time in Azure.

    You can certainly use Web Services as Ondrej suggests. Or you can also use Azure Queues. I wrote a blog about scaling with Azure Queues. It's a message based solution that runs on top of REST calls.

    What I am not clear about is your need to reach out to all the devices from Azure directly. Unless I misunderstood your scenario, you want an Azure role to "connect" to all existing devices, get data from them, perform some calculation in Azure, then push back the data to a device? This seems rather hard to do and error prone if your devices are not accessible - if your GPS devices register with the worker roles, and can be accessed by public DNS I guess you could do that. But personally I would lean towards a solution that only pushes data from the device into the cloud; it should be much easier that way. What kind of devices are you referring to? And what are you trying to do?