diff options
author | Goblin911 <goblinliu@gmail.com> | 2013-08-26 17:23:04 +0800 |
---|---|---|
committer | Goblin911 <goblinliu@gmail.com> | 2013-08-26 17:23:04 +0800 |
commit | 9b17e1808a93840c265123925c2b60e55c2ec930 (patch) | |
tree | db8886235b797cbcc877101b0d785a04cbb8f000 /client/Piztor/src/com/macaroon/piztor/SocketClient.java | |
parent | 92c5473740f45883c719002d4bc47236c669f51e (diff) |
fix some bugs of socket thread
Diffstat (limited to 'client/Piztor/src/com/macaroon/piztor/SocketClient.java')
-rw-r--r-- | client/Piztor/src/com/macaroon/piztor/SocketClient.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/client/Piztor/src/com/macaroon/piztor/SocketClient.java b/client/Piztor/src/com/macaroon/piztor/SocketClient.java index 812de05..703b974 100644 --- a/client/Piztor/src/com/macaroon/piztor/SocketClient.java +++ b/client/Piztor/src/com/macaroon/piztor/SocketClient.java @@ -18,6 +18,7 @@ public class SocketClient { IOException {
try {
client = new Socket(site, port);
+ client.setSoTimeout(1000);
} catch (UnknownHostException e) {
throw e;
} catch (IOException e) {
@@ -27,6 +28,7 @@ public class SocketClient { public void sendMsg(Req req,Handler recall) throws IOException {
try {
+
DataOutputStream out = new DataOutputStream(
client.getOutputStream());
int tmp = req.type;
|