Commit Graph

41 Commits

Author SHA1 Message Date
e5d66f46c6 deal with a race on close
more zealous bc synchronization
make sure we always close the streams explicitly
logging
2004-08-15 20:48:35 +00:00
bc46ad4331 only block adding more *outbound* data, not handling data received from I2P. The data has already been received by the router and delivered to the streaming lib (and is sitting in RAM anyway...)
logging
2004-08-07 06:35:46 +00:00
be08e8f23b use the env defaults when no i2cp info is specified 2004-08-07 06:28:29 +00:00
f937809903 have a write() timeout after 60s instead of blocking forever by default (also used when injecting data into an input stream) 2004-08-06 22:24:56 +00:00
8add433966 javadoc 2004-08-01 20:25:25 +00:00
c5b289fb1f javadoc fixes 2004-08-01 18:47:12 +00:00
f85ce180ed * added a way to control how large we let the buffers grow before we block,
or even whether to have the blocking action timeout and close the socket after
a certain delay
* refactored the I2PSocketOptions to be more actively used
* added a pair of ministreaming lib demo apps:
- StreamSinkServer listens to a destination and dumps any data it receives on a socket to a per-socket file
- StreamSinkClient sends a destination a specified number of random bytes, then disconnects
2004-08-01 18:34:02 +00:00
604bcd5874 initial impl 2004-07-20 21:28:28 +00:00
37d5531737 logging, including replacing the scary monster with its true self (we had data queued up, but were unable to get an ACK on our last write) 2004-07-16 20:48:40 +00:00
7b9db07f13 target=1.3 and source=1.3, not target=1.1 and source=1.3
(this is what caused the runtime errors on sun jvms but not on kaffe)
((aka i slacked and didn't test sufficiently.  off with my head))
this now builds and runs fine in sun 1.3-1.5 jvms, as well as kaffe
2004-07-12 16:39:22 +00:00
3bc0e0fc8a added source and target declarations for the javac commands so we can build with the 1.5^W5.0 JDK
(also added deprecation, since, well, we can :)
2004-07-11 04:16:59 +00:00
15b1cbd762 synchronize the available() call, and made explicit some other synchronization 2004-07-01 15:11:34 +00:00
9640e93895 imports
shendaras
2004-06-30 13:21:15 +00:00
72727dacd8 javadoc 2004-06-28 13:22:03 +00:00
caeb2bc4e3 the actual fix for the local eepsite problem (if getRemoteID was called *after* the remoteID was set, it would wait for 60s then fail. now we check for that)
synchronization cleanup (never get two locks)
logging
2004-06-28 13:21:18 +00:00
13974b601f added some stats (viewable on the router stat page when the i2ptunnel is run in the router's VM)
lots of logging
2004-06-28 13:18:18 +00:00
5c1e001a73 logging 2004-06-27 19:39:45 +00:00
e7e8ad9bdc add the socketErrorListener interface (sorry duck) 2004-05-19 22:30:52 +00:00
0942a7f3ff truckloads of logging
new async interface for error notification (e.g. you can get notified of an error prior to it throwing the IOException).
This async is useful since the IOException can be delayed for up to a minute while waiting for the close packet to be delivered.
The alternative is to fire off a new thread to do the closing, and we may want to go there later, but i'm not sure.
2004-05-19 15:14:30 +00:00
292363eb65 imports (sorry, includes alphabetizing, wee)
(shendaras)
2004-05-17 03:38:53 +00:00
ff0023a889 big ol' memory, cpu usage, and shutdown handling update. main changes include:
* rather than have all jobs created hooked into the clock for offset updates, have the jobQueue stay hooked up and update any active jobs accordingly (killing a memory leak of a JobTiming objects - one per job)
* dont go totally insane during shutdown and log like mad (though the clientApp things still log like mad, since they don't know the router is going down)
* adjust memory buffer sizes based on real world values so we don't have to expand/contract a lot
* dont display things that are completely useless (who cares what the first 32 bytes of a public key are?)
* reduce temporary object creation
* use more efficient collections at times
* on shutdown, log some state information (ready/timed jobs, pending messages, etc)
* explicit GC every 10 jobs.  yeah, not efficient, but just for now we'll keep 'er in there
* only reread the router config file if it changes (duh)
2004-05-16 04:54:50 +00:00
07b6a8ba92 if we lose our I2CP connection to the router, die hard and fast.
(only relevent for people whose socket manager / i2ptunnel / etc are located remote from the router)
2004-05-07 07:01:26 +00:00
f772d6ddeb /me reboots brain, understands, and thanks mihi 2004-05-07 04:19:43 +00:00
4021deec7f poke jrandom's eyes into the semantic of an "else" clause
(you may remove both comments when you understood it)

[mihi]
2004-05-07 03:10:57 +00:00
a3977f37f7 javadoc, no functional changes 2004-05-07 03:06:41 +00:00
766c12242e logging, javadoc 2004-05-07 01:45:12 +00:00
a82b951aff made private things that don't need to be public
remove semantic inconsistency wrt getRemoteId(false) - it shouldn't ever timeout, since it always returns immediately
javadoc (though i wish i understood the close/close2/sendClose more clearly so i could javadoc that process)
2004-05-07 01:32:48 +00:00
691326cea8 make sure we kill the threads that failed to ACK, rather than leave them sitting there, waiting forever
logging
2004-05-04 08:09:28 +00:00
3cac1238ed handle reclose, logging, more clear notification 2004-05-04 05:53:11 +00:00
3a4d0549aa add accept timeouts (default is that if the server doesnt .accept() in 5s, refuse the con)
add unique IDs to the various threads for logging / tracing purposes
2004-05-04 04:44:05 +00:00
d7467f5dc3 disconnect isn't an error 2004-05-04 01:58:37 +00:00
60584228d9 refactored packet handling into type specific methods
removed nested synchronization (which had been causing undetected deadlocks)
made sync blocks smaller, though this may have opened holes related to
resent ACK/SYN/CLOSE packets that are delivered in a race.  I'm not as
fluent in the ministreaming lib code as i should be (yet), but duck's thread
dumps were showing hundreds of threads waiting on a lock that'll never get
released (since the only way to release it would be to receive another
packet, and no more packets can be received until the lock is released, etc)
also, I2PSession is threadsafe - i can see no reason to synchronize on it
(and it was being synchronized on only part of the time?)
also, refactored the charset encoding stuff and minor log tweaking
i've been testing this for the last hour or so, on eepsites and squid (large
and small files), as well as irc, and there haven't been any glitches.  but
it needs more testing before it can be released, obviously.
2004-05-03 03:34:25 +00:00
d7c3a53f2d Initial implementation of read() timeout on I2PSocket. Let's see whether it
could solve duck's problems with dangling threads...
(human)
2004-04-21 17:56:16 +00:00
8038e1ee7d I2PSocketManager.connect() should have thrown InterruptedIOException, and *not*
InterruptedException (oops!)
(human)
2004-04-20 15:38:55 +00:00
fb170e3c42 * Made I2PSocketManager.connect() throw several kinds of exceptions, for
better error reporting;
* Added an I2PSocketManager.destroySocketManager() method, that closes all
  the managed sockets and destroys the associated I2PSession.
(human)
2004-04-19 21:45:04 +00:00
031338d84d First step for the "connection refused" concept: incoming connections
won't be accepted until the server app actually requires an I2PServerSocket
from the I2PSocketManager.
It allows both to add a little bit of functionality, and to fix a nasty bug: it
was possible to hang an app that connects through the I2PSocketManager but
actually doesn't accept() connections (if 2 connection requests were sent
to the app, the I2PSocketManager got stuck waiting forever on
I2PServerSocketImpl.getNewSocket()).
2004-04-16 03:31:13 +00:00
d2b09ecfda * Fixed race that (maybe) caused the problems reported by aum on
<http://dev.i2p.net/pipermail/i2p/2004-April/000214.html>;
* slightly revised locking;
* made accept() throw a ConnectException when the I2PServerSocket is closed.
(human)
2004-04-14 15:28:02 +00:00
51c49d7c1b format (shendaras) 2004-04-10 11:50:11 +00:00
8a8e68146f beginning of format, updated imports. (shendaras) 2004-04-10 11:39:00 +00:00
f37c0ed612 name all threads, and (nearly) always use I2PThread (in case we add some pooling/throttling/monitoring or whatnot later) 2004-04-09 01:22:04 +00:00
77bd69c5e5 beginning of branch i2p.i2p.i2p 2004-04-08 04:41:54 +00:00