Commit Graph

5452 Commits

Author SHA1 Message Date
Michael Bayne 01ac320432 When a peer connects to us, turn around and immediately connect back to them.
Don't wait up to 60 seconds for the next peer refresh interval.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5514 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:33:23 +00:00
Michael Bayne 38e352443f Nixed more debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5513 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:27:12 +00:00
Michael Bayne c81f970590 Nixed debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5512 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:26:59 +00:00
Michael Bayne c4909a5a5c We need to start our connect() process on the conmgr thread and we also need to
properly handle a connecting connection becoming idle.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5511 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:21:02 +00:00
Michael Bayne 89f02fc728 Created ServerCommunicator which does all I/O using the ConnectionManager's
polled socket system. This much more cleanly and efficiently integrates peer
(and other server to server) connections into the normal server I/O framework
and should also eliminate for good the annoying server hangs that result when
our old blocking client I/O threads got their pants wedged.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5510 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 00:27:07 +00:00
Michael Bayne b81ccde75b ClientFactory -> SessionFactory, etc.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5509 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-06 18:24:44 +00:00
Michael Bayne c69630b7e0 PresentsClient -> PresentsSession (Jamie's suggestion) and associated changes
on down the client.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5508 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-06 18:04:42 +00:00
Ray Greenwell a9f7175d2f Removed unused import.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5507 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-05 23:13:08 +00:00
Ray Greenwell ff20abf27d Fixed parameter reading on Windows.
(We are parsing a URL, and even though it represents a file, it's still
a URL, so it uses the standard slash and not the microsoft slash.)
This will make SDK testing work on Windows.
We suck a lot for not fixing this sooner, but
- I didn't have Windows set up for development.
- It was broken for so long, we deprioritized and then sorta forgot about it.
This has been broken for over 5 months, when I last touched this file
to make it work on Macs.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5506 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-05 23:11:49 +00:00
Par Winzell 1a467468ff Don't fill the array with zeroes when we reinitialize the Throttle with the same number of operations as we already had, as that allows a potentially dangerous burst of operations.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5505 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-05 17:17:41 +00:00
Par Winzell bb670e14a8 When we reinitialize the Throttle with a smaller number of allowed operations within a time period, we should preserve the oldest rather than the newest ones, or we'll most likely be in immediate and unfair violation of the limit.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5504 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-05 00:21:17 +00:00
Ray Greenwell 2a6940363d Rollback r5502.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5503 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-04 21:42:18 +00:00
Tom Conkling b9245e9be8 In keeping with Adobe's convention, Set and Map's forEach() function takes an optional 'thisObject' param
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5502 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-04 20:21:26 +00:00
Par Winzell f17e0efd07 The throttle update cannot be applied in a Runnable, or we get a race condition against the frames coming in from network. The actual _throttle is only ever access from the network thread, so only _pendingThrottles needs extra care.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5501 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-04 19:55:06 +00:00
Par Winzell 4bc5627d82 Let's have Set implement forEach, like Map does.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5500 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-04 18:21:29 +00:00
Jamie Doornbos 14755a6cea Fixed fundamental flaw with throttling code. Changed the client to adjust its message rate when it actually sends the throttle updated message. Otherwise the client starts sending at the new rate before the server knows about it. Keep the messages per second in the message.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5499 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-04 08:37:13 +00:00
Jamie Doornbos ed002196b0 Missed a line from the previous change. Added comment for new ArrayUtil method
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5498 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-04 08:33:05 +00:00
Jamie Doornbos 4633684fb6 Copied code from java implementation of Throttle.reinit(). After testing, I found this method was leaving older values in the middle of younger values
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5497 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-04 06:41:00 +00:00
Ray Greenwell be8597a5c1 Headless building for happy Mac development.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5496 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-04 01:40:45 +00:00
Jamie Doornbos 7a3f264d43 Minor changes to previous fix. Log runnable, event or message that is being posted to the inactive queue. Remove instanceof check since the invoker will always be of the expected type
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5495 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 23:14:47 +00:00
Michael Bayne e843684637 Fix typo.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5494 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 23:01:45 +00:00
Michael Bayne f60713de17 Between the time that we're shutdown and the time that we finally exit, do not
accept new connections or read incoming messages from any of our extant
connections. Do send outgoing messages to those connections, but nothing else.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5493 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 23:00:07 +00:00
Jamie Doornbos e97d19476b Be less harsh and just log a warning in case some shutdown methods rely on posted events or messages being silently ignored (invoker still throws however, because it was throwing before)
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5492 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 22:49:25 +00:00
Jamie Doornbos 82d4f36c1a Fixes for shutdown sequence, including prevention of a race condition
* Throw an exception if any events, runnables or messages are posted after shutdown. These were previosuly being silently ignored. We really should know about them.
* Don't exit the connection manager thread until the object manager thread exits. This fixes a race condition where the wakeup time of the conmgr thread would determine if it shutdown before or after the object manager, meaning it would sometimes ignore messages around shutdown time.
* Add a shutdown constraint to make the client manager shutdown before the invoker/event/conmgr threads. This gives a single point in the shutdown sequence that applications can use as a constraint (TODO: shutdown groups?)
* Emit a log message for each shutdown method call. This could be very useful in production.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5491 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 22:20:16 +00:00
Jamie Doornbos 0cb3330de7 Refix for long running clients (r5483). I must have introduced this at the last minute when switching my original -32768 to use Short.MIN_VALUE instead, forgetting to remove the negation
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5490 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 19:26:57 +00:00
Jamie Doornbos 055ae0cc98 Allow bureau clients to report fatal errors if something goes wrong, like oh I don't know... maybe a disconnection perhaps
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5489 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-01 00:31:53 +00:00
Mike Thomas dc99a123ad Helps if we actually call the function that's able to be overridden.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5488 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-31 21:46:47 +00:00
Charlie Groves 0906ccdca5 Things work better when you set values and whatnot
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5487 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-31 20:31:51 +00:00
Charlie Groves 15c66260ea Take ChangeListeners in SafeSubscriber's constructor that will start listening
to the subscribed object when it becomes available and will stop listening when
we unsubscribe.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5486 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-31 18:33:59 +00:00
Michael Bayne a3e74276f5 Implement these listeners in helper classes rather than in ourselves where they
become undesirably part of our public interface.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5485 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-31 17:33:26 +00:00
Michael Bayne 7d4a594929 Truth in method naming.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5484 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-30 22:31:15 +00:00
Jamie Doornbos ed0718674e Fixed bug with long running clients. The results for invocation requests with ids exceeding Short.MAX_VALUE could not be processed due to the id being deserialized as a short but stored in the map with an integer key.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5483 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-30 17:15:42 +00:00
Mike Thomas f511469901 Purge the use of the getChatName() hack.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5482 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-29 22:26:56 +00:00
Mike Thomas 815f7b5b44 Allow the output stream to be overridden just like the input stream on the config registry.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5481 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 22:47:13 +00:00
Michael Bayne 677e06b193 Let's have a nice toString().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5480 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 22:16:38 +00:00
Michael Bayne 7d5d10e2f8 Ray wants size() and I don't want mutators. I'll compromise and return an
immutable list.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5479 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 20:40:35 +00:00
Dave Hoover da52d29a0a Javadoc nitpickery
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5478 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 20:37:28 +00:00
Michael Bayne 826a1a0bcc Added getLocals().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5477 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 20:25:08 +00:00
Michael Bayne 6fd2882fa9 Actually we need to set up our local attribute here.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5476 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 20:02:51 +00:00
Jamie Doornbos b9ab203c0c Fixed Throttle bug causing any increase in the number of operations to block all message throughput. Fix prevents copying from negative indices of _ops. This caused a NaN entry which always resulted in an effective age of 0 regardless of getTimer(), causing a permanent state of throttling
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5475 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 18:00:55 +00:00
Michael Bayne d1be746bdb Created ClientLocal and BodyLocal which is where we'll track server-only
information.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5474 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 17:55:17 +00:00
Michael Bayne c544146c45 Brevity is going to be our friend here.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5473 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 17:53:40 +00:00
Michael Bayne 7c52427d83 Added local attributes to DObject. These are objects that are stored only on
the local JVM (in general we'll use them on the server). The idea is to get rid
of all of our messy transients in BodyObject on down (and possibly other
places) and encapsulate them in a nice ClientLocal object (extended to
BodyLocal and on down).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5472 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 17:46:27 +00:00
Michael Bayne 1b7e182b18 Make some assertions.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5471 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 17:44:39 +00:00
Jamie Doornbos d9f5328f1c Fixed recent breakage of actionscript bureaus. Apparently tamarin does not like constant members assigned in a base class? Weird but plausible if it (buggily) sets up all members of a class and assigns defaults values before constructing bases.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5470 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-27 07:54:38 +00:00
Michael Bayne 6c4f37d49f Drive by de-whitespace-excessificiation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5469 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-26 21:08:21 +00:00
Michael Bayne ded19474bc Added foo/s to various report output.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5468 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-26 20:59:24 +00:00
Michael Bayne ce7cc1bc96 Added PeerService.generateReport().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5467 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-26 20:19:32 +00:00
Michael Bayne 8aeb239f64 Only put our header on logged reports, not reports generated by explicit
callers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5466 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-26 20:12:03 +00:00
Michael Bayne f17740894e Out vile tabs.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5465 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-26 20:09:18 +00:00