Hm...i will explain  scenario in detail:

1. Client sends data  to server.
2. Client expects data from server.
3. I put breakpoint in server code just before session.write()
4. I kill client.
5. I resume server.


Server code :

(breakpoint)        final WriteFuture future =
session.write(transformator.transform(context.getResponse().getParameters()));

        //uzimanje terminala.
        final Terminal terminal =
(Terminal)context.getParameter("terminal");

        future.addListener(new IoFutureListener<IoFuture>(){

            @Override
            public void operationComplete(IoFuture ioFuture) {
                try{
                    //WriteFuture newFuture =
(WriteFuture)ioFuture;//.await();
                    //TODO napisati kako treba.
                    if (future.isWritten() ){
                        //data send to terminal
                        log.info("podaci su poslati terminalu
"+terminal.getId());
                    }else{
                        log.info("podaci nisu poslati terminalu
"+terminal.getId());
                        //provera da li je doslo do greske pri slanju
odgovora.
                        Throwable t = future.getException();
                        if (t != null){
                            log.error("Greska u slanju odgovora
terminalu",t);
                        }
                    }
                }catch(Throwable t){
                    log.error("Greska ", t);
                }

            }});


//System.out.println(""+context.getResponse().getParameter(TerminalKeys.ERR));
        context.endProcessing();


future.isWritten() returns true allways.







On Sun, Jul 27, 2008 at 1:25 PM, Mark Webb <[EMAIL PROTECTED]> wrote:

> Maybe I am missing something, but if operationComplete is called, then the
> message was written to the client.  So this tells us that the message was
> placed on the wire.  If the client is dead at this time, an exception
> should/would be generated.  The server has no way of knowing that the
> client
> has actually processed the message because it is in another process and
> there is no way to communicate that the message was processed unless an
> acknowledgment is sent to the client.
>
>
>
> On Sun, Jul 27, 2008 at 6:25 AM, Zlatko Josic <[EMAIL PROTECTED]>
> wrote:
>
> > Yes you right...but this approach is not good enough because it has to
> much
> > messages in protocol.
> > I still don'nt know why MINA framework can not detect is data send to
> > client.
> >
> >
> > On Sat, Jul 26, 2008 at 10:52 PM, W.B. Garvelink <
> > [EMAIL PROTECTED]
> > > wrote:
> >
> > > If I understand your requirement correctly, you may have to implement
> > > an ARQ mechanism, that is, make the client send acknowledgement
> > > messages to the server and make the server keep track of them.
> > >
> > >
> > > On Sat, Jul 26, 2008 at 4:41 PM, Zlatko Josic <[EMAIL PROTECTED]>
> > > wrote:
> > > > Data sends to client ends with '\n'.
> > > > Client is not alive at the moment server sends data to client.
> > > > WriteFuture.isWriiten() allways returns true.
> > > >
> > > > How can I in MINA address tihs problem? It is very important for
> > project
> > > I'm
> > > > working on.
> > > >
> > > > Thanks for any idea.
> > >
> >
>

Reply via email to