Peer 2 peer

Hello All, I hope I have choosen the right forum to post this question. I’m attempting to create a one-to-one video chat application. I’m looking for the best way to do some random matchmaking. I can easily set up direct connections send data, audio, video which is great! Also I can set up a easy p2p connection which works fine.

However, I want to implement a random matchmaking feature through p2p…Basic
example a user clicks on a button and chats to a random person. How would i go
about grabbing a random peer in the same group…that’s not in direct connection
with someone else already?

Maybe i could use object replication. When someone connects to the
groupspecifier I could then push another object into the shared array that has
the peerID then i could just alter the array?

Or, maybe i could use the sendToNearest method…but wouldnt that be not the
best way to match people?..because you can only have so many neighbors. I think
if you had 500 peers in the group you be only connected to a few peers who are
considered neighbors.right? Basically, you be connected to the same 5 to 10
people everytime.

I look forward to and be interested to hear your thoughts and opinions on
this matter…