Changeset 2f2aa7f for apps/ministreaming


Ignore:
Timestamp:
Nov 13, 2014 8:12:55 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
9104bd7
Parents:
0773a30
Message:

I2PTunnel:

  • Fix bug that left server acceptor thread running after close
  • Add destroy() methods to release all resources when closing a tunnel for good, particularly the streaming timer threads
  • Use COWAL to prevent concurrency problems
  • Javadocs

Streaming:

  • Don't return null from accept() any more; actually throw ConnectException? as the javadocs have always specified
  • Throw ConnectException? from accept() if interrupted; previously caught and ignored
  • Throw exceptions from ConnectionHandler?.accept(), not higher up
  • Close ServerSocket? when ConnectionManager? is shut down
  • Synchronize setActive(), clear queue when starting to accept, better handling of calls that don't change state
  • Javadocs

ConfigClientsHelper?: Call isPluginRunning() less often
PluginStarter?: Simplify detection of active threads

Above changes mostly in support of zzzot plugin implementing ClientApp?
and being able to shut down completely so there are no threads
in its thread group, so /configclients will all show status as stopped.
Previously, the I2PTunnelServer acceptor thread and
one or more streaming timer threads would remain.

Location:
apps/ministreaming/java/src/net/i2p/client/streaming
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocket.java

    r0773a30 r2f2aa7f  
    2121     * connection and the local application wasn't .accept()ing new connections,
    2222     * they should get refused (if .accept() doesnt occur in some small period).
    23      * Warning - unlike regular ServerSocket, may return null.
     23     * Warning - unlike regular ServerSocket, may return null (through 0.9.16 only).
    2424     *
    25      * @return a connected I2PSocket OR NULL
     25     * @return a connected I2PSocket OR NULL through 0.9.16; never null as of 0.9.17
    2626     *
    2727     * @throws I2PException if there is a problem with reading a new socket
    28      *         from the data available (aka the I2PSession closed, etc)
    29      * @throws ConnectException if the I2PServerSocket is closed
    30      * @throws SocketTimeoutException
     28     *         from the data available (e.g. the I2PSession is closed)
     29     * @throws ConnectException if the I2PServerSocket is closed, or if interrupted.
     30     *         Not actually thrown through 0.9.16; thrown as of 0.9.17
     31     * @throws SocketTimeoutException if a timeout was previously set with setSoTimeout and the timeout has been reached.
    3132     */
    3233    public I2PSocket accept() throws I2PException, ConnectException, SocketTimeoutException;
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManager.java

    r0773a30 r2f2aa7f  
    5858    public I2PSocketOptions getDefaultOptions();
    5959
     60    /**
     61     *  Returns non-null socket.
     62     *  This method does not throw exceptions, but methods on the returned socket
     63     *  may throw exceptions if the socket or socket manager is closed.
     64     *
     65     *  @return non-null
     66     */
    6067    public I2PServerSocket getServerSocket();
    6168   
Note: See TracChangeset for help on using the changeset viewer.