Hi,

In the context of long poll implementation in jpoker, and poker-network,

It has been agreed that jpoker need to poll packets only one server, the
explain server, which is connected to all the server the user is
suscribed to (by playing on a table).

Yesterday you described the long poll mecanism as the following:
(11:59:40 AM) dachary: let say pollQueue is empty and there is a pending Poll. 
A packet is sent to pollQueue. There is no packet in front, it is sent. There 
is a pending Poll, no other Poll is sent. And the queue flag is set to WAITING 
FOR POLL.
(11:59:47 AM) dachary: another packet is sent to the pollQueue, 
WAITING_FOR_POLL is set, therefore it's not sent.
(11:59:53 AM) dachary: The poll returns, the flag is cleared and the first 
packet in the queue is sent.
(12:00:01 PM) dachary: There is no pending poll (because the previous one just 
returned)
(12:00:08 PM) dachary: therefore another Poll is sent and the WAITING_FOR_POLL 
flag is set.
(12:00:16 PM) dachary: there are no pending packets, a Poll is sent and will 
hang as long as it takes to return something

(12:10:43 PM) dachary: another packet is sent to the pollQueue, 
WAITING_FOR_POLL is set, therefore it's not sent, instead a PollReturn packet 
is sent to force the Poll to return.

I think it could be simpler if we connect only to the explain server,
and use Ping packet instead of Poll:

If the data is always returned through Ping packets, we can use
ajaxQueue for non-ping outgoing packets, and use a regular looping ajax
for polling using Ping.

There is no race condition since the only connection returning data is
ajax Ping.

However it means that more than one connection will be open at a given
point of time, but that's also a limitation you need to have if
implementing "PollReturn".

Feel free to tell me what you think.
-- 
Johan Euphrosine <[email protected]>

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Pokersource-users mailing list
[email protected]
https://mail.gna.org/listinfo/pokersource-users

Reply via email to