On Tue, 2008-10-07 at 13:35 -0700, David Zhao wrote: > Hi, > > I'm using http-client 3.1 in a java desktop client. I've noticed an > issue with doing file uploads while getting connection interrupted, > for example, a wifi connection that is no longer available. When that > happens, my client would freeze in FilePart#sendData where it times > out in the write method of java Socket. > > After digging around, I found this article: > http://209.85.173.104/search?q=cache:7lA5d6FTgzYJ:https://lists.spline.inf.fu-berlin.de/lurker/message/20071121.145132.dd820d54.es.html+SocketOutputStream+does+not+time+out&hl=en&ct=clnk&cd=1&gl=us&client=safari > > which describes: > ------------------------------------ > AFAIKS, the actual problem here is: > java.net.SocketOutputStream.write() is > always a blocking operation, and it is also not by the java socket API > to > specify a timeout for write operations. Thus, it is simply not > possible to > return from SocketOutputStream.write() until all data are transferred > or the > TCP Stack gives up. > ------------------------------------ > > Does anyone know of a work around for this issue? >
I suspect the only option would be to use a NIO based transport. Oleg > Thanks, > > -David > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
