More on lost data

bgoetzmann bgoetzmann at sophia.symag.com
Fri Jun 25 08:03:01 EDT 2010


Hello again,

I've more information about my problem; I done more tests without the user
interface, and I found a context in which a file sent is not completely
received.

In my scenario, I always send the same file many times from the client part,
and save the data received for each connection always into a new file.

Here what is done on the client side:

bootstrap = new ClientBootstrap(...


// This is done 20 times

ChannelFuture future = bootstrap.connect(new InetSocketAddress(host, port));

if (!future.awaitUninterruptibly().isSuccess())
    System.out.println("Erreur !");

// Wait until the connection is closed or the connection attempt fails.
future.getChannel().getCloseFuture().awaitUninterruptibly();

try {
    Thread.sleep(1000);
} catch (InterruptedException ex) {
}

// end of loop

The client handler I use send always the same file to the server part.

Actually, if I do 20 connections to send the file, and with a sleep of 1
second, there is no problem: the files are written with no error (files are
same as the original).

But if I use, for example 500 ms, for the sleep, some written files contain
less data than the original, as if some data was lost! And it seems that
more you use a small value for the sleep, more you have files in error.

Please, any idea?

I think I become crazy ;-)

Bertrand.
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Netty-and-JavaFX-tp5217198p5221765.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list