user2302807
user2302807

Reputation: 335

Best way to send data to a non-browser client behind NAT and firewalls?

Here is the scenario:

  1. Client #1 put some info to the server (using an HTTP request)

  2. Server keeps that info and wait for client #2 to put his info too. Time between client #1 and client #2 calls can be from a couple of seconds to several hours.

  3. When client #2 put his info to server, server return client #1 infos to client #2 through the HTTP request.

  4. Server then need to return the client #2 infos to client #1.

How can I return client #2 infos to client #1, assuming that client #1 cannot be directly reached (NAT, firewall) and that the time between the two calls can be very long?

I would like to avoid client #1 to regularly poke the server... Clients are not using a web browser to connect to the server but a custom application where we have total control

Upvotes: 0

Views: 472

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 597941

The client will have to poke the server periodically, if the client closes its connection anytime between steps 1 and 4. Otherwise, let the client keep its initial connection open waiting for a server-side push of the data, even if it takes hours, then close the connection once the data arrives.

Upvotes: 2

Related Questions