Printer example

20 views
Skip to first unread message

Ricardo Aguirre

unread,
Mar 6, 2012, 5:27:08 AM3/6/12
to ya...@googlegroups.com
Hi
I'm using yami4 to build a Controller (mvc pattern) now is really similar to the  printer example; with the only difference that will have many clients
and it run's well "with no errors", but it seems that Server is loosing some calls, when I make many calls,
it seems that Server is loosing some calls.
....


I read that exist a yami4 cache feature,
but I don't really understand if I can use it to solve my current "lost calls" problem

Thank you for your help.

--Panzón

Maciej Sobczak

unread,
Mar 6, 2012, 1:07:28 PM3/6/12
to yami4
Hi,

On 6 Mar, 11:27, Ricardo Aguirre <el.mas...@gmail.com> wrote:

> I'm using yami4 to build a Controller <http://pastebin.com/6JpCXbUm> (mvc
> pattern) now is really similar to the  printer example; with the only
> difference that will have many clients <http://pastebin.com/eikvsvYk>
> and it run's well "with no errors", but it seems that Server is loosing
> some calls, when I make many calls,
> it seems that Server is loosing some calls.

I think that you observe the problem that the client (the sender)
finishes before all the queued messages are processed by its agent.
This problem is solved by the synchronized version of the client -
please see how the synchronized client differs from the basic one and
try to apply a similar strategy in your program.

Regards,

--
Maciej Sobczak * http://www.inspirel.com

Ricardo Aguirre

unread,
Mar 6, 2012, 2:35:21 PM3/6/12
to ya...@googlegroups.com
The problem was the earlier Client Termination.
That's explain the reason some times Server lost some of the last calls.
But I don't understand why...
Does it depends the used tcp protocol
... I don't know
anyway 
Thank you

--Panzón



2012/3/6 Maciej Sobczak <see.my....@gmail.com>

Maciej Sobczak

unread,
Mar 6, 2012, 6:13:51 PM3/6/12
to yami4
On 6 Mar, 20:35, Ricardo Aguirre <el.mas...@gmail.com> wrote:
> The problem was *the earlier Client Termination*.
> That's explain the reason some times Server lost some of the last calls.
> But I don't understand why...

The reason for this is that when you call the "send" function, the
message is inserted into the outgoing queue, where it waits for the
nearest opportunity to be physically sent out. If there are many
messages created in a short period of time, they will accumulate in
the queue before they are physically sent. If the process is
terminated in the meantime, some of the messages might never be sent
over the wire.
In order to solve this, the application should involve some additional
logic to ensure that it does not finish prematurely - this might be as
simple as explicitly waiting for the proper message state.
Reply all
Reply to author
Forward
0 new messages