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.
On Sat, Jul 26, 2008 at 3:57 PM, Oscar <[EMAIL PROTECTED]> wrote:
> *'operetaionComplete method is called and future.isWritten()
> returns true' *could indicate that data have been sent to client.
>
> In your case, I guess it's about *br.readLine().
>
> *Are you sure the data sent to client ends with '\n'?
>
> *
> *On Sat, Jul 26, 2008 at 9:00 PM, Zlatko Josic <[EMAIL PROTECTED]>
> wrote:
>
> > Ok...but I still don't know does client get data.
> >
> >
> > Before server sends date to client I shutdown the client and write date
> to
> > the session.
> > After that operetaionComplete method is called and future.isWritten()
> > returns true.
> >
> > Is there any way to find did date delivered to client ?
> >
> > On Sat, Jul 26, 2008 at 2:49 PM, Mark Webb <[EMAIL PROTECTED]>
> wrote:
> >
> > > The line:
> > >
> > > WriteFuture newFuture = (WriteFuture)ioFuture.await();
> > >
> > > is not necessary in the operationComplete method. When the
> > > operationComplete method is called, it means that the write has
> > completed.
> > > Check the javadocs...
> > >
> > >
> > >
> > > On Sat, Jul 26, 2008 at 8:36 AM, Zlatko Josic <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > how find out is message sent to client. Server has to know is message
> > > > delivered to client.
> > > > I try something like this but it does'nt work :
> > > >
> > > > IoSession session = (IoSession)context.getParameter("ioSession");
> > > > //pisanje podatka u sesiju.
> > > > WriteFuture future =
> > > >
> > > >
> > >
> >
> session.write(transformator.transform(context.getResponse().getParameters()));
> > > >
> > > > future.addListener(new IoFutureListener<IoFuture>(){
> > > >
> > > > @Override
> > > > public void operationComplete(IoFuture ioFuture) {
> > > > try{
> > > > WriteFuture newFuture =
> > (WriteFuture)ioFuture.await();
> > > >
> > > > if (newFuture.isWritten()){
> > > > //podatak je poslat terminalu.
> > > > 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 = newFuture.getException();
> > > > if (t != null){
> > > > log.error("Greska u slanju odgovora
> > > > terminalu",t);
> > > > }
> > > > }
> > > > }catch(Throwable t){
> > > > log.error("Greska ", t);
> > > > }
> > > >
> > > > }});
> > > >
> > >
> >
>