Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 02b0a8c

Browse files
author
Chris Board
committed
Ensures low level TCP socket errors are handled by the IConnectionInterface
Ensures low level TCP socket issues such as connection timed out don't just throw an exception internal within the library - it will not pass the error up back into the IConnectionResult interface.
1 parent 0020aca commit 02b0a8c

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed
0 Bytes
Binary file not shown.

AndroidMySQLConnector/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ else
2020
}
2121

2222
archivesBaseName="AndroidMySQLConnector"
23-
version '0.42'
23+
version '0.44'
2424
group 'com.BoardiesITSolutions'
2525

2626

@@ -30,8 +30,8 @@ android {
3030
//applicationId "com.BoardiesITSolutions.AndroidMySQLConnector"
3131
minSdkVersion 19
3232
targetSdkVersion 29
33-
versionCode 30
34-
versionName "0.42"
33+
versionCode 32
34+
versionName "0.44"
3535
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3636
}
3737
buildTypes {

AndroidMySQLConnector/src/main/java/com/BoardiesITSolutions/AndroidMySQLConnector/Connection.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ public Connection(String hostname, String username, String password, int port, I
130130
this.connect();
131131
}
132132

133+
public IConnectionInterface getiConnectionInterface()
134+
{
135+
return this.iConnectionInterface;
136+
}
137+
133138
public Charset getCharset() {
134139
//If the charset hasn't been set yet - probably because we haven't yet read the server
135140
//language from the welcome packet, default it to uft-8

AndroidMySQLConnector/src/main/java/com/BoardiesITSolutions/AndroidMySQLConnector/SocketSender.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ protected Void doInBackground(byte[]... bytes)
5959
catch (IOException | InterruptedException ex)
6060
{
6161
mutex.release();
62-
Log.e(TAG, ex.toString());
62+
if (this.mysqlConn.getiConnectionInterface() != null && ex instanceof IOException)
63+
{
64+
this.mysqlConn.getiConnectionInterface().handleIOException((IOException)ex);
65+
}
66+
Log.e(TAG, "IOException: " + ex.toString());
6367
}
64-
6568
return null;
6669
}
6770

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
buildscript {
55

66
ext {
7-
publishToMavenLocal = false
7+
publishToMavenLocal = true
88
}
99

1010
repositories {

demoapplication/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ dependencies {
3030
implementation fileTree(dir: 'libs', include: ['*.jar'])
3131

3232
implementation 'androidx.appcompat:appcompat:1.1.0'
33-
implementation 'com.github.BoardiesITSolutions:Android-MySQL-Connector:0.42_MySQL8'
33+
implementation 'com.github.BoardiesITSolutions:Android-MySQL-Connector:0.44_MySQL8'
3434

3535
}

0 commit comments

Comments
 (0)