Commit graph

32 commits

Author SHA1 Message Date
ehouse
45bdccd4e8 Format time more compactly 2009-09-18 03:50:01 +00:00
ehouse
493d3c226f log when crash 2009-08-20 12:12:43 +00:00
ehouse
acbf8180ef add missing lock(); track and display uptime of daemon child as well as parent 2009-07-31 12:56:04 +00:00
ehouse
503db9cc6f up copyright 2009-07-30 12:54:17 +00:00
ehouse
8284799abe Fix crashes resulting from deleting cref instances in one thread while
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.)
2009-07-28 05:15:26 +00:00
ehouse
8a0d963c95 include abbreviated uptime in stat row 2009-07-16 02:56:25 +00:00
ehouse
fbe95478ba rename now() as uptime(); drop NTHREADS to 1 for now; include time of
server boot in connName and keep counter in memory rather than a file.
2009-03-10 12:52:17 +00:00
ehouse
1b49a26736 do loglevel and ports via the general-purpose config mech. No special
cases remain.
2009-03-05 13:49:01 +00:00
ehouse
3bf116c936 Add an http interface (read-only web console). 2009-02-28 16:15:59 +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
4c191e0755 Don't specify g++ version; add some consts to fix warnings with newer g++. 2008-05-21 03:49:11 +00:00
ehouse
da93ed5b31 Don't use uninitialized values as port numbers; use match for set as well as get. 2007-12-03 00:45:09 +00:00
ehouse
25c4368231 Start adding ability to listen on multiple sockets and to dynamically
change the set listened on.  There's still some debugging to do but
nothing that worked before is broken.  Also begin to accept unique
prefixes (e.g. g for get) for commands and attributes on the control
port.  Note that relay-related code in comms seems broken now, but is
without this checkin.
2007-12-01 15:00:30 +00:00
ehouse
8dbfe4ed79 fix new compiler warnings; daemonize, and add handler to kill child if
parent dies so that script can kill based on pid file.
2007-11-13 03:53:10 +00:00
ehouse
0291ec1e75 Turn on self-spawning: main loop should never crash but exists only to
respawn child when it does.  Add crash command to test this.  Add
ability to set logging level from ctrl port.
2007-11-10 05:41:49 +00:00
ehouse
9f23c4b4d9 Replace ints with bools; add rev command; fix bug by reiniting args with each
command so they don't hold previous values.
2007-02-07 13:22:40 +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
4df7b3d75a add uptime 2005-10-19 03:39:18 +00:00
ehouse
74b6ccbd52 cleanup ctrl printing; repeat most recent command; cleanup internal names. 2005-10-16 01:19:25 +00:00
ehouse
936e3bd110 clean up command help 2005-10-15 16:28:26 +00:00
ehouse
b7e3479989 print prompt 2005-10-14 08:26:56 +00:00
ehouse
4e5f69f4e8 rename states so can format to 80 cols; add log level param. No
change to functionality in this checkin.
2005-10-02 16:08:42 +00:00
ehouse
77319b570d make transmitted vars smaller where possible; new relay identifying
scheme where cookie is used only to connect, and is replaced for
reconnects by a relay-generated name that's supposed to be unique
across all games on all relays and includes a hostname read in from
config file; relay assign non-servers' hostIDs.
2005-10-01 16:33:45 +00:00
ehouse
f944b154fc fix print_cookies to use iterator 2005-09-14 05:14:41 +00:00
ehouse
8f32f4f99a loads of changes: get settings from config file; remove sockets and
kill crefs via state machine, and protect access to a cref so it can
die without another thread being in it; do timers via timeout to
poll() rather than interrupt (and integrate into state machine);
detect when all players are present and change state so new
connections on that cookie will get a new cref.
2005-09-02 06:56:34 +00:00
ehouse
40351e187b add several new commands 2005-04-20 11:57:26 +00:00
ehouse
a809a057e4 mutex replaced by rwlock 2005-04-08 14:17:28 +00:00
ehouse
e3151bdfe2 add command parsing and dispatch table 2005-03-31 02:20:50 +00:00
ehouse
db3ce42a4f this file owns thread creation now 2005-03-30 01:52:10 +00:00
ehouse
3d40cc0e5c add cmd to lock/unlock main mutex 2005-03-25 03:24:00 +00:00
ehouse
dc25eb9e35 first checked in. 2005-03-19 22:16:49 +00:00