Commit graph

21 commits

Author SHA1 Message Date
Eric House
2a35fac1e8 rather than invalidating socket in AddrRec when it's closed, add a
timestamp set when it's opened.  Older copies with the same socket can
be tested against the cannonical copy maintained by tpool and sending
avoided when the timestamp shows the endpoint has likely changed.
Change tpool's list of sockets to a map for faster lookup, and get rid
of similar structure in udpqueue.
2013-06-21 06:05:26 -07:00
Eric House
a546c025d5 Rather than queuing sockets needing reading, read them immediately and
queue the packets for processing.  Add ids so they can be tracked in
the logs.  In addition to making tcp and udp packet processing more
similar this fixes the case where a read is delayed until after the
client has closed the connection (and so returns an error.)
2013-06-17 07:25:25 -07:00
Eric House
5e0fd89c9e update with all relay/ changes from gtk_multigame. This is what the
live relay's running anyway.
2013-02-04 06:08:39 -08:00
Eric House
98679c8363 cleanup: better encapsulation for AddrInfo 2013-01-13 10:14:06 -08:00
Eric House
c567647a8d get rid of mapping of socket->game_connection, which will not work
once UDP sockets and/or per-device (not per-game) connections come
along.  Lots of changes, most not involving code flow but a couple
that did.  So far two gtk games can connect and exchange moves.
Haven't tested reconnection or store-and-forward.
2013-01-12 16:09:24 -08:00
Eric House
55514719be include thread ptr in hung threads logging; assert (restart) when hung for too long 2013-01-11 20:42:04 -08:00
Eric House
ad78129e74 changes made over the past couple of months toward tracking an
apparent thread leak.
2013-01-02 21:12:42 -08:00
Eric House
caa40fa023 store most recent IP address each device has come in on. Requires new
column in db.  Not really used yet but interesting to watch....
2012-01-04 18:14:12 -08:00
Eric House
725888cb6c run proxy sockets through same thread pool as game sockets. This
prevents race conditions that are turning up when I'm running multiple
threads -- by allowing me to really not be running multiple threads.
Tested with the usual script.
2011-01-20 18:14:56 -08:00
Andy2
c44324a32a log, for now as I've seen assertions failures suggesting a race, the
set of checked-out sockets at insert and remove time.
2010-09-23 06:34:18 -07:00
Eric House
4ad735124c add logging and assertions. There's a race condition in cref
recycling and may be one in tpool socket checking-out.
2010-09-20 22:11:13 -07:00
Andy2
df1ec1628a replace killSocket(), which jumped right into crefmgr and could get
ahead of processing data arrived on the same socket, with EnqueueKill
that adds to same queue from which data's taken.  So if device dies
immediately after sending data there won't be a race between closing
the cref (if this is the last open socket) and handling the data.  I'm
still dying with assert fails when running 100 games at once, but much
less frequently
2010-09-18 08:47:56 -07:00
Andy2
53b3d7c32f enque sockets in new object that contains type so later other events
(e.g. socket closes) can also be queued; track what sockets are
currently being handled so no two threads are ever processing events
on same socket.  This makes running 'NGAMES=50
./scripts/discon_ok2.sh' crash very infrequently rather than every
time, but the race condition in crefmgr remains.  Queuing socket
closes should help.
2010-09-18 07:44:14 -07:00
ehouse
582eb88f9a int->bool 2009-07-13 02:58:16 +00:00
ehouse
ea6fff8f28 replace int with bool where appropriate; fix to compile with newer g++ 2008-12-30 05:13:30 +00:00
ehouse
92485783af update email address in header comments: no code change 2006-01-08 01:25:02 +00:00
ehouse
deb0a2d265 shutdown in response to SIGINT 2005-10-23 15:49:48 +00:00
ehouse
eb8301ade7 return error to client when flags indicate old version; close sockets
when error occurs in processing message.
2005-10-14 08:29:58 +00:00
ehouse
7036e53229 move to using rwlock 2005-04-20 12:03:58 +00:00
ehouse
54843e68bf fix warnings 2005-04-08 14:28:04 +00:00
ehouse
99d713bd8a first checked in 2005-03-30 01:47:55 +00:00