diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-05-07 10:42:52 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-05-07 10:42:52 +0200 |
commit | 30ed4171fa09923d9b3c0365a3f1a4bc7a1658b0 (patch) | |
tree | 83f8fc0a67588a85a069b1087daf305e2f87b540 /src | |
parent | 655369064fc63d781f819002918179c8b9d30c4b (diff) | |
download | TwitterDataAnalytics-30ed4171fa09923d9b3c0365a3f1a4bc7a1658b0.tar.gz |
Set read timeout for streaming
Diffstat (limited to 'src')
-rw-r--r-- | src/io/StreamImpl.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/io/StreamImpl.java b/src/io/StreamImpl.java index 61cdf59..5dd8981 100644 --- a/src/io/StreamImpl.java +++ b/src/io/StreamImpl.java @@ -304,6 +304,9 @@ public class StreamImpl implements Stream { postData += "&language=en"; HttpURLConnection conn; conn = (HttpURLConnection) new URL(STREAM_URL).openConnection(); + // timeout of 90 seconds is recommended at + // https://dev.twitter.com/docs/streaming-apis/connecting#Stalls + conn.setReadTimeout(90000); conn.setRequestMethod("POST"); // set request headers conn.addRequestProperty("Content-Type", |