Object indexes are unique to the group and they should always point to the same object data.
When you do...
...you are declaring "i have these pieces of informations willing to share" to the group
Your second call with the same parameters would have no effect as you have already declared that and the group already "knows" you have those; since the peers who wanted them already have these fetched they're no longer needed and NetGroup.Replication.Request does not get called again
For a different file you should assign different id's for "startIndex" and "endIndex" and make sure the ranges never overlap; given your piece of code it looks like you always start at 0; throughout the group never send different data under the same object index
Ok thanks very much
I figured out another solution, and that is :
When publisher finishes with sending packages it will invoke removeHaveObject, thatway after publishing another data subscriber will addWantObject with correct ids.
Sorry but that's not how object replication is intended to work.
Even if data originates at some single peer, your "publisher", the others should also contribute (addHaveObjects) once they received some pieces, to redistribute these within the mesh, otherwise you will be exhausting the publisher's bandwidth and missing a lot of what object replication has to offer.
This way there's no telling for the "publisher" when everybody has all the data and can move on sending the next "file" under the same indexes. Also, the information should also be available for peers that join at a later time.
If you want to send data "on demand" from a single peer and only to whoever is present at the time you can do this via group multicast [NetStream.send()]
I see ... but problem is that i want to send file to everybody present at the moment, if i use netstream.send() that way i will be sending data using UDP and there is no way to be sure that all data is transfered correctly
With object replication i can be sure that data will be sent to all peers
What do you think about it ?
Setting NetStream.dataReliable to true should take care of data integrity despite the UDP.
Dont really know what would happen to peers that lack the bandwidth to receive all that's being sent into the netStream, i guess something would eventually get lost at high datarate.
If your "files" are small and/or unfrequent multicast may be the way to go. Otherwise it's back to object replication.
Let us know how it went.