summaryrefslogtreecommitdiff
path: root/src/main/TweetShell.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/TweetShell.java')
-rw-r--r--src/main/TweetShell.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/TweetShell.java b/src/main/TweetShell.java
index 2b3b078..608a15a 100644
--- a/src/main/TweetShell.java
+++ b/src/main/TweetShell.java
@@ -6,6 +6,7 @@ import io.OAuthRequester;
import io.StreamImpl;
import java.io.Closeable;
import java.io.IOException;
+import java.net.SocketTimeoutException;
import java.util.Arrays;
import java.util.Map;
import java.util.NoSuchElementException;
@@ -68,6 +69,20 @@ public class TweetShell implements TwitterApi.PinSupplier {
@Override
public void exceptionGenerated(Exception ex) {
System.err.println("Stream closed due to " + ex);
+ /* Disabled because it deadlocks in WorkerContainer.finish
+ // to solve that if necessary, start commit in a new thread
+ if (ex instanceof SocketTimeoutException
+ || (ex instanceof IOException
+ && ex.getMessage().endsWith("Read timed out"))) {
+ try {
+ System.err.println("Trying to reconnect.");
+ getStream().commit();
+ } catch (IOException ioex) {
+ System.err.println("Failed to re-connect: "
+ + ioex.getMessage());
+ }
+ }
+ */
}
}