From e7e8ad9bdcb1c8909d9eae9476bd90e1ede0541f Mon Sep 17 00:00:00 2001
From: jrandom <jrandom>
Date: Wed, 19 May 2004 22:30:52 +0000
Subject: [PATCH] add the socketErrorListener interface (sorry duck)

---
 .../src/net/i2p/client/streaming/I2PSocket.java | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java
index 3a12a508e8..844052782c 100644
--- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java
+++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java
@@ -50,4 +50,21 @@ public interface I2PSocket {
      * Closes the socket if not closed yet
      */
     public void close() throws IOException;
+    
+    public void setSocketErrorListener(SocketErrorListener lsnr);
+    /**
+     * Allow notification of underlying errors communicating across I2P without
+     * waiting for any sort of cleanup process.  For example, if some data could
+     * not be sent, this listener is notified immediately, and while the input/output
+     * streams are notified through IOExceptions, they are told only after the 
+     * TCP-like stream is closed (which may be a minute later, if the close message
+     * times out as well).  This is not fired on normal close() activity.
+     *
+     */
+    public interface SocketErrorListener {
+        /**
+         * An error occurred communicating with the peer.
+         */
+        void errorOccurred();
+    }
 }
-- 
GitLab