• Post Reply Bookmark Topic Watch Topic
  • New Topic

duplicate inputstream

 
kotesh rao
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

my server side code is reading inputstream from client.
This inputstream i am passing to saxparser.
Saxparser is able to parse the document, its working fine.

my client may get disconnected. so i have to start resending the complete file to server again.

Instead i want to create a temp file and same time i want to send the inputstream to Saxparser. is this possible ?

hope got my question.

I want to do this so that i can save the transmission time from client to server. if client gets disconnected i only send the remaining part of the file.

Thanks in advance..
Kotesh.
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are talking about two different problems: First, you want functionality similar to the unix command tee, where you split an input stream. That's easy. Read from an input stream and write the same data to two output streams. Second, you want to have a file upload resume capability. That's a bit more complex because you need some way to tell the client where to resume the upload.
If I were you I'd concentrate on the file upload resume and just send the file, when complete to the parser (if that fits with your program requirements).
 
kotesh rao
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Resuming file upload is ok. I am able to handle it.

what u said is correct..once the file is complete we send to saxparser to parse it.

but my problem is, its taking lot of time..
1. to get the file from client say 10mins then
2. to parse the file again 10mins. total - 20mins.(approx double the time)

other way..which i want to do.
write the stream to file and also pass stream to parser both at a time.

ya i want to do 2 things....so that server can respond fastly to user.

Kotesh.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!