setting connName when all in a game are present. Second, have every
host include in connections a random number. That number is made part
of the connName and in general used to test whether a host belongs in
a particular game. Add this "seed" to web interface. Means new
versions for relay protocol and game stream format. Latter is handled
correctly so older games can be opened.
another wanted to operate on them. The root problem is that you can't
dispose of a mutex while somebody's blocking on it. So now the
locking mutexes live inside the cref class. When the lock owner
realizes the cref needs to die, it sets a flag and it's moved to a
recycled list. A thread blocking on the mutex will then get it, but
checks the flag and releases it immediately if it's being recycled.
(Also improve the http interface a bit.) With these changes I've run
31K (and counting) games against the relay without a crash or deadlock
(using sim_real.sh.) The main problem that remains is that sometimes
two games using the same cookie wind up with two crefs (and so never
connect.)
sockets found while reporting closed sockets (to avoid deadlock);
remove sockets from crefmgr's map when closing them so new connections
using same (re-used) socket aren't treated as belonging to open games.