Hi,
I am actually programming a random chat like Chatroulette.
I use Flex + php to make the initial handshakes (connections) between the peers, and then p2p takes off. However the point of my thread is not specific to any programming language, it's more about the logic that I should use.
Quick summary of what I've tried and my actual situation :
In the random chat, the first thing I tried was that when somebody enters the random chat and searches for a random partner, he would be labeled as '0" in MySQL, and the system would try to match people labeled as "0" with other "0's". When a match is found, both people become "1's".
However the problem was that there has to be a 'caller' and a 'receiver', and the 'receiver' has priority.
So let's say "A" tried to call "B", and "C" tried to call "A", it would cancel all the connection, because both "B" and "A" had a priority incoming call. Basically the system would only connect lucky people, like when there was no "C" when "A" was calling "B".
That's a big problem, because with many people on, the luck would take too long to achieve and it would take minutes for people to find a match.
What logic would you guys approach this situation with? I've been thinking for a while, and I think randomly labeling people as either 'caller' or 'receiver' in MySQL could be a good idea, it should minimize the 'missed connections', but it may still not be optimal.
Thanks
No replies to this topic
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









