I'm trying to come up with the best way to do some random match making in a simple chat application..
While experimenting with netStreams I can easily set up direct connections, send data, text, video, sound which is great. I find it pretty easy to get a simple P2P connection going, and it works just like i need it to.
But I really want to implement a random matchmaking feature so everything is through p2p...
How would I go about grabbing a random peer by clicking a button thats in the same group...that's not in a direct connection with someone else already?
-I was thinking maybe I could use object replication...and when someone connects to the GroupSpecifier, I could then push another object into this shared array that has the local peerID and their status. then i could just alter the array when they're in the application. But then im worried there is no guarantee that their entry will get removed if the person just closes the web window.
-I also thought about just doing a "post" to the group containing the nearID, and other peers can get the post...and those that aren't in the chat application will try and direct connect back. Then that side will then connect to them. so then theyll both be in direct connections with each other. But then i feel like if potentially 100s of people that are "available"...get the post...then they all try and connect to one person, then it could cause problems.
-Also, I thought about just doing sendToNearest...but wouldnt that not be the best way to match people...because you can only have so many neighbors i think... if there were 1000 people in the group. youll only be able to connect to a few peers actually considered your neighbor right? Then basically you could end up just matching up with the same 5-10 people or however are technically considered a neighbor.
I would love to hear your thoughts and suggestions if you have any.