Eric House
909640c82f
cleanup/improve logging
2013-06-26 00:36:02 -07:00
Eric House
c587848349
cleanup
2013-06-21 06:59:44 -07:00
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
46bd4d0047
inval tcp sockets in return addresses of packets waiting processing
...
when they're closed to prevent attempting to write replies to the
wrong device should the socket be reopened.
2013-06-20 07:07:56 -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
e89fd3e8cc
fix names to make units clear -- no code change
2013-06-10 06:38:42 -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
7ecf57c556
increase size of buffer for incoming proxy packets, since now that I
...
have 50+ saved network games requests for moves are that big. (This
is a temporary fix.)
2013-01-26 18:48:57 -08:00
Eric House
dc0cfdf001
bug in recent changes: need to mark socket unused to avoid double removal
2013-01-13 10:37:47 -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
03e6db5107
remove logging
2012-01-03 18:27:25 -08:00
Eric House
166d8f8c03
log number of sockets tracked -- it's climbing on server and I need to
...
figure out why. This and listening for POLLRDHUP are a start (but not
sufficient).
2011-12-15 18:41:07 -08:00
Eric House
8e31fd88c3
reduce logging; and fix valgrind-found problem using wrong
...
synchronization primative.
2011-06-29 21:37:33 -07:00
Andy2
57cfefb6a9
fix leaks -- that don't really matter as process is exiting, but
...
quiets valgrind.
2011-06-29 18:45:02 -07:00
Eric House
44af266db6
add logging
2011-06-20 18:10:42 -07:00
Andy2
9f76bdede9
hold mutex for slightly shorter time
2011-03-31 18:16:56 -07: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
3ae62e4704
use an index rather than a ptr to track fd array (so a parallel array
...
can be added)
2011-01-19 18:36:24 -08:00
Eric House
a444786a28
reduce logging
2010-10-05 20:57:19 -07:00
Eric House
1ff4d67bc0
block TERM and INT from all but the main thread. (Pretty much untested; doesn't fix hang-on-SIGINT.)
2010-10-04 20:03:00 -07: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
Andy2
be23e06b60
use read_packet to replace duplicate code
2010-09-21 06:38:43 -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
Eric House
ddcc338ed7
don't break out of loop without unlocking mutex
2010-09-14 21:16:16 -07:00
Eric House
89e7a506a4
reduce amount of logging
2010-09-08 20:28:14 -07:00
ehouse
53133839a4
don't log list of sockets by default
2009-08-20 03:50:40 +00:00
ehouse
503db9cc6f
up copyright
2009-07-30 12:54:17 +00:00
ehouse
6b1cf247bf
Don't alloc storage for fds and log buffer each time through poll
...
loop; instead reuse and realloc when needs to grow.
2009-07-28 05:08:15 +00:00
ehouse
dddd5e1dd8
clean up logging. I got some cores that suggest overflow. This fixes
...
that if indeed it was happening. Problems with sockets disappearing
while in poll may remain.
2009-07-16 04:43:33 +00:00
ehouse
582eb88f9a
int->bool
2009-07-13 02:58:16 +00:00
ehouse
a680a6e5fe
Always close sockets we're done with. Otherwise they leak -- don't get reused.
2009-07-06 01:32:30 +00:00
ehouse
1ac4ef3bc6
Attempt to detect connections that are duplicates by checking if that
...
socket is already in a connection. This doesn't seem to always work,
and I may be leaking cref instances when it does, so needs debugging
still.
2009-02-01 16:00:20 +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
767b9f2908
initialize mutex before using; fixes a hang since could never aquire
...
lock. (This bug has always been there, but didn't matter before;
maybe pthreads changed.) Comment out self-spawning stuff until can
fix df-transfer problems. Other minor changes around logging.
2007-02-06 05:52:22 +00:00
ehouse
4c2259400a
include result of strerror in messages logging errno
2007-02-03 21:35:07 +00:00
ehouse
b29bde8e37
include stdio.h for freebsd
2006-03-21 04:05:33 +00:00
ehouse
92485783af
update email address in header comments: no code change
2006-01-08 01:25:02 +00:00
ehouse
d17165a678
add header needed on some installations
2005-10-23 21:35:19 +00:00
ehouse
deb0a2d265
shutdown in response to SIGINT
2005-10-23 15:49:48 +00:00
ehouse
74b6ccbd52
cleanup ctrl printing; repeat most recent command; cleanup internal names.
2005-10-16 01:19:25 +00:00
ehouse
ecf5875d7e
capitalize public methods on timermgr (no code change)
2005-10-15 15:49:22 +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
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
235556240f
Don't close the underlying socket. Not sure yet when I should close a
...
socket that hasn't returned an error. Maybe that's the client's job.
2005-09-05 15:45:22 +00:00