Feature #2939
StreamFile class for easy stream read/write with IOCipher
Status: | New | Start date: | 02/07/2014 | |
---|---|---|---|---|
Priority: | High | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | - | |||
Target version: | 0.3.1 | |||
Component: |
Description
Ok, I found the best example. I tweaked the TransferThread in this project to make it more flexible.
This also has my hacked jni to create pipes and some of my exploratio on how to hook up all the threads to get around blocking.
On Fri, Aug 23, 2013 at 10:59 AM, Josh Steiner <josh@scal.io> wrote:
Ok, here was my plan of attack.
Make StreamFile derive from java.io.File. @Override methods such as getAbsolutePath( and getFD(). If this is the firsdt call, create two pipes using JNI, one of in one for out. also spin up two threads to attach to both pipes.
One of the tricky spots here is attaching to the pipes will block the java calls until both ends are hooked up, so you also have to use a thread (AsyncTask) just to do the hooking up. I hacked my way into this and got lost in a deadlock nightmare, but done carefully this should work.
Once all that is setup you can return a real FD or path.
Then @Override the close() method and kill the threads and delete the pipe files.
My reader/writer threads were modeled after this:
History
#1 Updated by hans almost 4 years ago
- File PipeTest.tgz added
#2 Updated by hans almost 4 years ago
- Target version set to 0.2 - reliability and cacheword interop
#3 Updated by hans almost 4 years ago
- Tracker changed from Task to Feature
- Subject changed from StreamFile example to StreamFile class for easy stream read/write with IOCipher
#4 Updated by hans almost 4 years ago
- Priority changed from Normal to Urgent
#5 Updated by hans almost 4 years ago
- Priority changed from Urgent to High
#6 Updated by hans over 3 years ago
- Target version deleted (
0.2 - reliability and cacheword interop)
#7 Updated by hans over 3 years ago
- Target version set to 0.3
#8 Updated by hans almost 3 years ago
- Target version changed from 0.3 to 0.3.1