youngj/EnvayaSMS — Issue #16: poll timeout increase for near realtime outgoing delivery
Author: magixbox
Created: 2011-11-29 23:13:23+00:00
State: open

I would like to suggest a method that we are using at http level to achieve "near instant" of message delivery between server and client where the client can only pull the server for incoming message -- browser based chat system for example -- which is very similar to what EnvayaSMS doing now to get message from server.

When the client (the browser or EnvayaSMS) connect to the server via http, instead of giving it a short timeout of couple seconds, it should wait for a pre-defined period of time before dropping off the socket (40 seconds seems a magic number, the desktop browser would wait like forever).

The server holds the connection and continue to lookup up for new message for the client during the "hold-on" time - for a pre-defined period of time as well (again, 40 seconds is the magic number).

The server will return empty and end the http session if there isn't any new outgoing SMS (just like a usual outgoing call).
However, if these IS new outgoing SMS incur during the hold-on period, the server will immediately respond with proper XML and end the http session (again, just like a usual outgoing call).

By doing so, we believed message can be relayed more efficiently without tapping more on the service/client resources.

What EnvayaSMS needs:
- Configurable "outgoing" query timeout.
- Poll interval can be as intense as 1 second (delay between queries) - provided timeout has increased.

I can see some troubles implement this if the "incoming" or "send_status" query are running in serial with the "outgoing" instead of independent thread.