Incidencia #23051

Socket error

Abrir Fecha: 2010-09-07 12:07 Última actualización: 2010-09-07 12:21

Informador:
Propietario:
Tipo:
Estado:
Open [Owner assigned]
Componente:
Hito:
Prioridad:
7
Gravedad:
7
Resolución:
Ninguno
Fichero:
Ninguno

Details

Error. Socket do not detect end of read from inputstream. Reference: (b = fi.read()) != -1 and do not detect socket timeout error. Tested with Mysaifu v 0.4.8 and SO Windows Mobile 6.1

OutputStream os = null; FileInputStream fi = null; BufferedOutputStream bos = null; try { System.out.println("Writing to: " + s.getRemoteSocketAddress() + " at " + new Date()); os = s.getOutputStream(); bos = new BufferedOutputStream(os); fi = new FileInputStream(fileBDZip); int b = -1, i = 0; while ((b = fi.read()) != -1) { bos.write(b); i++; if (i % 10240 == 0) { System.out.println((i / 1024) + " at " + new Date()); } } System.out.println("End Write at " + new Date()); fi.close();

bos.flush(); bos.close(); os.close(); s.close(); } catch (Exception e) { try { if (fi != null) { fi.close(); } if (bos != null) { bos.close(); } if (os != null) { os.close(); } s.close(); e.printStackTrace(); } catch (Exception ex) { ex.printStackTrace(); } }

Ticket History (2/2 Histories)

2010-09-07 12:07 Updated by: rafa
  • New Ticket "Socket error" created
2010-09-07 12:21 Updated by: rafa
  • Details Updated

Attachment File List

No attachments

Editar

Please login to add comment to this ticket » Entrar