Delete Shared Object

22 views
Skip to first unread message

Jesse Warden

unread,
May 31, 2011, 11:21:20 PM5/31/11
to Cocoon P2P
If I've shared an object with everyone is there a way to remove it?
I'm thinking like Remote SharedObjects data property here; if I've
issued a shareAll, and then later want to remove it; how do I do it? I
dug through the code, but nothing obvious jumps out at me.

The only thing I can think is to disconnect, and reconnect and ensure
clients don't actually bind to the receivedObjects, but rather just
listen to the event, and make a local copy of the ArrayCollection so I
can later issue a "sendMessageToAll" message that tells the clients to
"delete this object if you find it, k thanks!".

Make sense?

Dirk Eismann

unread,
Jun 6, 2011, 5:32:51 AM6/6/11
to cocoo...@googlegroups.com
Hi Jesse,

hmm... good question and a nice feature request :-)

Technically, if an object gets shared, a new NetGroup gets created for just this object and all peers who want to receive this file then join this NetGroup and request the object. The problem is that every peer that has received that object (or a chunk of it) automatically becomes a seeder (publisher) for that object as well and will act as a "hub" as well. So, to effectively remove an object from the NetGroup all peers in that NetGroup need to call NetGroup.removeHaveObjects() passing in the indices of all received chunks so far - also, you'll have to tell the ObjectManager to remove all references to the ObjectMetedataVO from the internal data structures dataDictionary, senderDictionary and receiverDictionary (these are actually wrapped by the sharedObjects / receivedObjects ArrayCollections). You could trigger the removal by sending a custom message to all peers.

No promises though that this will work.

Dirk.

2011/6/1 Jesse Warden <jesse....@gmail.com>

Jesse Warden

unread,
Jun 8, 2011, 9:39:59 PM6/8/11
to cocoo...@googlegroups.com
My use case was sharing a shared file, like a song. "Oh wait, I published the wrong song! Here's is 'mySong2'". To avoid confusion, the best user experience is just to delete the old one. I get, however, that you have it stored a lot of places + have to ensure the seeders abort their continued sharing.

I'd rather y'all just focus on reviewing my patches in a few weeks, heh!

Dirk Eismann

unread,
Jun 10, 2011, 9:32:54 AM6/10/11
to cocoo...@googlegroups.com
yep - it gets pretty complex as soon as you do distibuted p2p stuff :-)

Keeps us posted on your additions and the progress you make.

Dirk.


2011/6/9 Jesse Warden <jesse....@gmail.com>
Reply all
Reply to author
Forward
0 new messages