F
Florent Coué
Hi,
when I write and flush some data (several packets => several write()) on a
DataOutputStream associated to a Socket, from a certain quantity of data,
the last sent data are lost.
Is there any problem with the method flush() of OutputStream ?
Do you another solution that have a sleep() before closing socket ?
Here is a example of my program :
====================
Socket socket = new Socket();
socket.connect(new InetSocketAddress(adresseIP, port), timeout);
DataOutputStream output = new
DataOutputStream(socket.getOutputStream());
...
for (int i = 0; i < listData.size(); j++)
{
output.write( (byte[])listData.elementAt(i) );
}
output.flush();
output.close();
socket.close();
=======================
Thanks for help
Florent
when I write and flush some data (several packets => several write()) on a
DataOutputStream associated to a Socket, from a certain quantity of data,
the last sent data are lost.
Is there any problem with the method flush() of OutputStream ?
Do you another solution that have a sleep() before closing socket ?
Here is a example of my program :
====================
Socket socket = new Socket();
socket.connect(new InetSocketAddress(adresseIP, port), timeout);
DataOutputStream output = new
DataOutputStream(socket.getOutputStream());
...
for (int i = 0; i < listData.size(); j++)
{
output.write( (byte[])listData.elementAt(i) );
}
output.flush();
output.close();
socket.close();
=======================
Thanks for help
Florent