Skip to content

Commit

Permalink
优化tcpclient
Browse files Browse the repository at this point in the history
  • Loading branch information
longqingzhao committed Feb 16, 2019
1 parent 66569b1 commit 105ca27
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public void sendMessage(String res) {
try {
sc.write(charset.encode(res));
} catch (IOException e) {
if (nioResponse != null) {
nioResponse.clientError();
}
Log.e(TAG, "sendMessage", e);
}
} else {
Expand Down Expand Up @@ -129,6 +132,7 @@ private class ResponseThread extends Thread {
super("ResponseThread");
this.nioResponse = nioResponse;
}

@Override
public void run() {
try {
Expand Down Expand Up @@ -166,13 +170,15 @@ public void run() {
}
}
} catch (Exception e) {
if (nioResponse != null) {
nioResponse.clientError();
}
Log.e(TAG, "startClient", e);
}

}



}

public void release() {
Expand Down

0 comments on commit 105ca27

Please sign in to comment.