# Peer 2 peer

**URL:** <https://forum.kirupa.com/t/peer-2-peer/331488>\
**Category:** Uncategorized\
**Created:** [August 11, 2013, 4:01pm UTC](https://forum.kirupa.com/t/peer-2-peer/331488 "2013-08-11T16:01:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickyhay](https://avatars.discourse-cdn.com/v4/letter/r/3ab097/32.png) [@rickyhay](https://forum.kirupa.com/u/rickyhay)\
**Post date:** [August 11, 2013, 4:01pm UTC](https://forum.kirupa.com/t/peer-2-peer/331488/1 "2013-08-11T16:01:12Z")

</div>

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…
