Is it feasible to place an Idhttpserver in a Mobile App to receive instant messages from a remote server?

Asked

Viewed 105 times

0

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

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

But if I, when starting the application, send a request to the server so that it notes the IP and relates the same to the user login, it would be interesting and feasible to use an HTTP request from the server to the application, using this registered IP every time I needed to warn you of something?

I understand that HTTP requests are easier to get through routers, firewalls and NAT... I haven’t done a code test yet because I was wondering if anyone here has tried or heard of any results, positive or negative.

1 answer

0

Why don’t you use the technology Datasnap for client/server communication, you can make transactions via JSON which is much faster, but there are some particularities as to the technology, it depends on how you will want to work, with session, Invocation or server.

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

Session: The server maintains an instance of the Datasnap class per session, 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 having made a request to the server.

  • Because it only works if the server is Windows.

  • Out of curiosity, why do you want to make the app a server?... and the client is in charge of sending messages to the app?... would not be contrary.

  • Only if what you want is an in-app service that monitors new messages on the remote server.

Browser other questions tagged

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