Commit Graph

50 Commits

Author SHA1 Message Date
Mike Thomas d492a4b154 Be smarter about quick-disconnects, don't count them as preferred ports. If we have a disconnect within 5 seconds, we set the _next_ port in the list as our preferred port. This should address the windows network sharing issue.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4227 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-27 01:52:06 +00:00
Michael Bayne 77adfc15ec Revamped the basic Presents client to support attempts to connect to the server
on multiple ports, falling back from one to the next as appropriate.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4158 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-05-30 22:12:15 +00:00
Michael Bayne 5a2583470c Brought code in line with changes to Samskivert. I have not started to
genericize Narya data structures, nor make the existing code type safe. That's
going to be an extremely large project.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4007 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-10 08:59:30 +00:00
Michael Bayne 8d91fa9e7f Don't log a stack trace here.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4004 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-10 01:22:39 +00:00
Ray Greenwell 7a64be94f2 Goodbye, NestableIOException.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3788 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-20 02:09:18 +00:00
Michael Bayne 301c1cbe4d Dispatch the notification that the client failed to logon after we are
completely cleaned up so that an immediate attempt to logon using a
different configuration will not fail due to the client thinking it's
still logged on from the previous failed attempt.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3658 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-21 20:23:37 +00:00
Ray Greenwell 0192a84739 Print out extra information when the strange "invalid argument" socket
connect exception gets thrown.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3462 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-04-08 19:27:57 +00:00
Michael Bayne a4ac47fb04 Reinstated the Presents I/O refactor with the modification of ensuring
that authentication is processed on the dobjmgr thread rather than
requiring the caller to do the right thing (or not as the case happened to
be).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3433 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-28 21:49:19 +00:00
Ray Greenwell d58d1001ac Roll it all back.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3432 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-28 19:33:28 +00:00
Michael Bayne a285695ca8 I finally broke down and did the rewrite to fix the potential race
condition between the omgr thread and the conmgr thread. Now when the omgr
thread processes an event that is going out to the clients, it flattents
the message itself for each client that is to receive the message and the
flattened data is posted to the conmgr outgoing queue.

This means that once an event is finished processing, no further
modifications to any of the data associated with the event can effect the
data queued up to be sent to the client. This is a good thing, it will
eliminate or illuminate a very baffling class of bugs that we've sort of
been ignoring because we knew this could be the cause.

We used to take an event and flatten it directly into the direct buffer
from which we would do our socket write. Now we flatten it into a
temporary byte array. This means a metric shitload more garbage generation
and collection. We used to do the flattening on the conmgr thread, now we
do it on the omgr thread. This means a big redistribution of CPU demand.

Either of those things could result in a significant negative impact on
our performance, but we'll just have to deploy this stuff and find out.
Whee! If it turns out to be a serious problem, there are potential
optimizations that could be done by keeping a pool of direct buffers
around and flattening messages into them, relying on the fact that the
outgoing conmgr queue generally doesn't grow too large and we could
allocate tens to a hundred megabytes of memory for the outgoing queue if
we really needed to.

I'd also like to test the overflow handling stuff more. It didn't really
change in that everything just deals with arrays of bytes now instead of
unflattened messages, but I'll be more comfortable once I've seen all this
in action on ice where there may be few users, but they are just as likely
to experience lag and receive an overflow queue as users on the higher
traffic servers. There is code to log when overflow queues are created and
finally flushed and how much use they got while they were around, so that
should give us an indication of whether things are operating properly.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3419 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-19 08:39:19 +00:00
Michael Bayne 2f24fdb449 Truncate the text of the long message. We can figure out what it is from
the first 80 characters if this every actually discovers an anomaly rather
than just dutifully reporting every time someone updates really lengthy
crew news.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3409 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-15 17:08:55 +00:00
Andrzej Kapolka ad1edd6e69 Added standalone flag and special standalone logoff method to Client, options to BasicDirector to hold off on initializing directors not needed for standalone mode.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3393 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-10 02:06:43 +00:00
Michael Bayne 121f6d7e53 Did the refactoring necessary to get the client and server to live happily
together in one JVM and both interoperate with the AWT thread in a manner
so harmonious as to bring a tear to the eye. This was surprisingly much
easier that I expected, thanks to my eminently sensible initial design,
I'm sure. ;)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3360 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-20 00:37:34 +00:00
Michael Bayne c92a922678 The rabbit hole goes deeper. Now we can configure the client with a custom
classloader to use when unserializing objects off the network. Also fixed
the way custom classloaders were used as Class.forName(class, true,
loader) seems to be the proper way to go to have caching work and whatnot.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3268 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-10 01:23:44 +00:00
Michael Bayne d9eb445d84 Log if we write out big messages because I saw some stuff about bugs in
Windows where it wigs out and behaves as if the connection was reset by
the peer ("An existing connection was forcibly closed by the remote host")
if one writes messages bigger than about 25k. I can't imagine how we would
be sending such big messages to the server, but it's worth a check.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3159 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-21 23:36:27 +00:00
Michael Bayne a9720fd905 LGPLed the library. Hello world.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3099 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-27 02:21:06 +00:00
Michael Bayne d618d3c771 Eclipse suggested cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2971 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-25 14:50:28 +00:00
Michael Bayne 732c0aab41 Modified clock synchronization approach slightly so that we allow 5
seconds to pass in between ping/pong latency samples. Additionally, we
resync the clock every 10 minutes.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2748 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-08 20:20:39 +00:00
Michael Bayne 7efc5dfc32 Make the auth response data available to interested parties.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2713 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-07-17 21:39:15 +00:00
Ray Greenwell d1e2c532e4 Fixed typo with previous checkin. Must get sleep.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2640 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-05 00:33:43 +00:00
Ray Greenwell 7dd942b673 Start out the ping interval id at -1 so we can tell if it needs to be
unregistered.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2639 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-05 00:29:45 +00:00
Ray Greenwell 6cb3d605d7 Be sure to unregister the interval, even if the the reader exits before
we logoff.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2638 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-05 00:26:16 +00:00
Michael Bayne 5dd245dadf Make sure our socket connection is closed if authentication fails.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2399 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-04-10 22:02:59 +00:00
Michael Bayne ce85e2a157 Adjust should be static.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2203 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-21 05:27:48 +00:00
Michael Bayne b246384262 Enable toggling of network event logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2200 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-01-21 00:17:16 +00:00
Michael Bayne 45fb96c4f2 Rewritten to use the Java NIO library rather than the Berkeley NBIO
library. 100% pure baby! At least for the moment.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1958 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-11-18 18:53:10 +00:00
Michael Bayne 2f7399ed68 Added support for specifying a version string during the client
authentication process.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1870 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-31 18:44:34 +00:00
Michael Bayne 8252efeed1 No more ping verbosity.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1868 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-30 18:46:33 +00:00
Michael Bayne 98d19e055a Added facilities for idling out clients that have not communicated with
the server in 90 seconds. The client is set up to ping the server if it
has had nothing to say to it for other reasons in the last 60 seconds.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1860 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-10-29 23:51:26 +00:00
Michael Bayne c3191b9170 Brought code into line with the new streaming world order.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1606 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-23 05:52:49 +00:00
Michael Bayne 40cbabe20c Report when the connection fails.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1570 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-07-12 03:49:02 +00:00
Michael Bayne f0d7b8642b Need to ensure that we don't claim that the communicator is gone until
after both the reader and writer have exited (otherwise the reader could
exit before the writer which would result in the client chucking its
reference to the communicator which could subsequently bite us in the ass
if anyone tried to reference the client's distributed object manager when
the writer finally exited and triggered all of the clientDidLogoff
callbacks). Multithreaded programming is fun!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1396 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-27 01:37:07 +00:00
Michael Bayne b15d38b54d Relegated a shitload of logging to DEBUG status.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1361 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-05-15 23:54:35 +00:00
Michael Bayne 04f83e779e Report the host and port to which we're connecting.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1124 542714f4-19e9-0310-aa3c-eee0fc999fb1
2002-03-15 19:11:14 +00:00
Michael Bayne 8a4c46badc The first great Three Rings renaming. Cocktail changed to Narya, Cher
changed to Presents and Party changed to Crowd. Whee!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@431 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-11 04:07:54 +00:00
Michael Bayne ceca4b549a Modified Reader and Writer not to die if they have a problem reading or
writing a message.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@381 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-03 03:39:39 +00:00
Michael Bayne 027bb29769 Created fooCodes interfaces to go along with invocation service
packages. These contain all the message codes as well as error response
codes that are used by a particular invocation service.

Also changed client.LocationManager to client.LocationDirector and
chat.ChatManager to chat.ChatDirector to go along with the new philosophy
of naming the client-side managing entity for an invocation service a
director.

Also elimitated cocktail.util.Codes since it's no longer used as a central
repository for codes (instead they are in InvocationCodes and its
derivatives).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@368 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-10-01 22:14:55 +00:00
Michael Bayne 782e9501d6 Implemented object destruction; wired up some missing stuff; created a
test server to make some testing easier; various other cleanups.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@188 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-08-07 20:38:58 +00:00
Michael Bayne ae73c73ac4 Commented out debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@158 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-08-03 02:12:27 +00:00
Michael Bayne 0c59e20f23 Logon not login.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@121 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-07-25 00:26:44 +00:00
Michael Bayne d55ce27b2b Created a test service and provider and sorted out further details.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@71 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-07-19 07:48:25 +00:00
Michael Bayne 915f3db6f1 More work on invocation manager; modified startup sequence so that server
can get shit together before bootstrapping the client.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@68 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-07-19 07:09:16 +00:00
Michael Bayne 6663aae772 Beginnings of invocation services implementation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@67 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-07-19 05:56:20 +00:00
Michael Bayne 6a1de87f2a Further wired up the client side of the distributed object system. Removed
the facilities for fetching (without subscribing to) an object. This is
done extremely rarely and the user might as well just subscribe and
immediately unsubscribe because the dichotomy between fetching and
subscribing just served to overly complicate the internals for no good
reason.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@30 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-06-09 23:39:04 +00:00
Michael Bayne 89d073b13c Switched package from com.samskivert to com.threerings.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@12 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-05-30 23:58:31 +00:00
Michael Bayne bd58cbd199 Use LoopingThread for Reader and Writer.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@11 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-05-30 23:51:39 +00:00
Michael Bayne 33d93d3374 Har! More progress mateys.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-05-29 03:27:59 +00:00
Michael Bayne 6717f8d6e5 More code, more code, more kibbles and code.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-05-23 04:03:41 +00:00
Michael Bayne f8f3645f67 Further progress. Heeya!
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-05-22 21:51:29 +00:00
Michael Bayne 40ecd80e09 Initial revision of cocktail multiplayer networked gaming platform. (Far
from complete.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2 542714f4-19e9-0310-aa3c-eee0fc999fb1
2001-05-22 06:08:00 +00:00