Click here to Skip to main content
15,038,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to develop a website in ASP.NET Web Forms. In this website i want to connect any two online users randomly for a specified time (suppose 30 seconds).

I am thinking to add the users into a temp table(to keep a track of online users) and assign them a random number as soon as they log in and delete them from the temp table on log out.


1.I have no idea how to remove the user from the table on session expire or on browser close.

2.I am not sure how to connect two online users randomly (like in omegle). When User A and User C are connected User B should not be able to connect to "User A and User C"
Updated 8-Jan-13 21:54pm

1 solution

1 - you can't. the most you can do, is use a timeout based on a time stamp

2 - just mark each user as already connected to someone and don't connect them to someone else. A bit field in the DB.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900