Skip to content

Commit

Permalink
[TIMOB-26585] Android: Catch all TCP socket read and write exceptions (
Browse files Browse the repository at this point in the history
…#10490)

* [TIMOB-26585] Catch all read and write exceptions

* [TIMOB-26585] Fix formatting
  • Loading branch information
garymathews authored and lokeshchdhry committed Dec 19, 2018
1 parent 41bc8e8 commit 1699589
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public int readSync(Object bufferProxy, int offset, int length) throws IOExcepti
{
try {
return TiStreamHelper.read(clientSocket.getInputStream(), (BufferProxy) bufferProxy, offset, length);
} catch (IOException e) {
} catch (Exception e) {
e.printStackTrace();
String message = e.getMessage();
if (message == null) {
Expand Down Expand Up @@ -422,7 +422,7 @@ public int writeSync(Object buffer, int offset, int length) throws IOException
{
try {
return TiStreamHelper.write(clientSocket.getOutputStream(), (BufferProxy) buffer, offset, length);
} catch (IOException e) {
} catch (Exception e) {
e.printStackTrace();
String message = e.getMessage();
if (message == null) {
Expand Down Expand Up @@ -469,6 +469,17 @@ public void close() throws IOException
}
}

@Override
public void release()
{
try {
close();
} catch (Exception e) {
// do nothing...
}
super.release();
}

@Override
public String getApiName()
{
Expand Down

0 comments on commit 1699589

Please sign in to comment.