Changeset 9e18c7e for apps/ministreaming


Ignore:
Timestamp:
Mar 24, 2015 2:33:36 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f3d573c
Parents:
a975dc4
Message:

Streaming: Throw I2PSocketException when connection is reset,
display new error page in HTTP client (ticket #643)
javadocs

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

Legend:

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

    ra975dc4 r9e18c7e  
    77
    88/**
    9  * Defines how to listen for streaming peer connections
    10  *
     9 *  Streaming server socket returned by {@link I2PSocketManager#getServerSocket()}.
     10 *  Defines how to listen for streaming peer connections.
     11 *<p>
     12 *  Note that this is not a standard Java {@link java.net.ServerSocket},
     13 *  if you need one of those, use {@link I2PSocketManager#getStandardServerSocket()} instead.
    1114 */
    1215public interface I2PServerSocket {
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java

    ra975dc4 r9e18c7e  
    1010
    1111/**
    12  * Minimalistic adapter between the socket api and I2PTunnel's way.
    13  * Note that this interface is a "subinterface" of the interface
    14  * defined in the "official" streaming api.
     12 *  Streaming socket returned by {@link I2PSocketManager#connect(Destination)}.
     13 *<p>
     14 *  Note that this is not a standard Java {@link java.net.Socket},
     15 *  if you need one of those, use {@link I2PSocketManager#connectToSocket(Destination)} instead.
    1516 */
    1617public interface I2PSocket extends Closeable {
     
    2829     *  As of 0.9.9 will throw an IOE if socket is closed.
    2930     *  Prior to that would return null instead of throwing IOE.
     31     *<p>
     32     *  Note that operations on the returned stream may return an
     33     *  {@link IOException} whose <i>cause</i> as returned by
     34     *  {@link IOException#getCause()} is an {@link I2PSocketException}.
     35     *  If so, the client may retrieve a status code via
     36     *  {@link I2PSocketException#getStatus()} to provide specific feedback to the user.
    3037     *
    3138     * @return an InputStream to read from the socket. Non-null since 0.9.9.
     
    3744     *  As of 0.9.9 will throw an IOE if socket is closed.
    3845     *  Prior to that would return null instead of throwing IOE.
     46     *<p>
     47     *  Note that operations on the returned stream may return an
     48     *  {@link IOException} whose <i>cause</i> as returned by
     49     *  {@link IOException#getCause()} is an {@link I2PSocketException}.
     50     *  If so, the client may retrieve a status code via
     51     *  {@link I2PSocketException#getStatus()} to provide specific feedback to the user.
    3952     *
    4053     * @return an OutputStream to write into the socket. Non-null since 0.9.9.
  • apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketException.java

    ra975dc4 r9e18c7e  
    2121
    2222    /**
    23      *  Use canned message for this status code
     23     *  Router and I2CP status codes are 0 - 511. Start ours at 512.
     24     *  @since 0.9.19
     25     */
     26    public static final int STATUS_CONNECTION_RESET = 512;
     27
     28    /**
     29     *  Use canned message for this status code.
     30     *
     31     *  Standard codes from the router are 0-255, defined in MessageStatusMessage.
     32     *  Standard codes from client-side I2CP are 256-511, defined in SendMessageStatusListener.
     33     *  Standard codes from streaming are 512-767, defined here.
     34     *
    2435     *  @param status >= 0 from MessageStatusMessage or SendMessageStatusListener
    2536     */
     
    106117                return _x("Local destination shutdown");
    107118
     119            case STATUS_CONNECTION_RESET:
     120                return _x("Connection was reset");
     121
    108122            case CUSTOM:
    109123                return super.getMessage();
Note: See TracChangeset for help on using the changeset viewer.