Is it feasible to put an IdHTTPServer in a Mobile Application so that it receives instant messages from a remote server?

1

I want to make an application that receives notifications without browsing the server at all times, and is able to run in the background on Android. I will use the Firemoney platform, which uses object pascal to replace java. I'll use the Indy library for client / server implementations.

With the use of UDP appear the barriers of NAT and Firewall, both in WAN and in LAN, that is, in WiFi or in 3G / 4G I will have problems.

But what if I, when I started the application, send a request to the server for it to write down the IP and relate it to the user login, would it be interesting and feasible for me to use an HTTP request from the server to the application , using this registered IP every time I need to warn you something?

As far as I know the HTTP requests are easier to get through routers, firewalls and NAT ... I have not done a code test yet because I wanted to know if anyone here has tried or heard of any positive or negative result.     

asked by anonymous 28.06.2016 / 19:30

1 answer

1

Because you do not use DataSnap technology for client / server communication, you can make transactions via JSON which is much faster, but there are some particularities about technology , depends on how you want to work, with session , invocation or server .

Server: The server maintains a single instance of the class on the server, all clients requesting this class will always receive the same instance.

Session: The server maintains one instance of the class per session of DataSnap, each client receives a different instance of the class.

Invocation: At each execution of a server method an instance of the class will be created and then destroyed.

And the DataSnap technology itself disconnects after you have made a request to the server.

    
10.03.2017 / 15:50