From 81f2dac854f9c6d54aff92f37533e13d7b5f022a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=80=EC=9A=B4?= Date: Tue, 7 Jan 2025 09:41:29 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[Setting]=20gradle=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .idea/compiler.xml | 19 +---- .idea/misc.xml | 16 +---- .idea/modules.xml | 10 --- .idea/modules/SocketclusterClientJava.iml | 12 ---- .../modules/SocketclusterClientJava_main.iml | 15 ---- .../modules/SocketclusterClientJava_test.iml | 17 ----- build.gradle | 72 ++++--------------- gradle/wrapper/gradle-wrapper.properties | 6 +- 9 files changed, 21 insertions(+), 147 deletions(-) delete mode 100644 .idea/modules.xml delete mode 100644 .idea/modules/SocketclusterClientJava.iml delete mode 100644 .idea/modules/SocketclusterClientJava_main.iml delete mode 100644 .idea/modules/SocketclusterClientJava_test.iml diff --git a/.gitignore b/.gitignore index f21d23c..9cda306 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # From https://github.com/github/gitignore/blob/master/Gradle.gitignore .gradle /build/ +local.properties # Ignore Gradle GUI config gradle-app.setting diff --git a/.idea/compiler.xml b/.idea/compiler.xml index a6163a6..d2d94f3 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,24 +1,7 @@ - - - - - - - - - - - - - - - - - - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 9793229..d15a481 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,19 +1,7 @@ - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 29c228d..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/SocketclusterClientJava.iml b/.idea/modules/SocketclusterClientJava.iml deleted file mode 100644 index ef226b0..0000000 --- a/.idea/modules/SocketclusterClientJava.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/SocketclusterClientJava_main.iml b/.idea/modules/SocketclusterClientJava_main.iml deleted file mode 100644 index 8d02020..0000000 --- a/.idea/modules/SocketclusterClientJava_main.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules/SocketclusterClientJava_test.iml b/.idea/modules/SocketclusterClientJava_test.iml deleted file mode 100644 index c514b2d..0000000 --- a/.idea/modules/SocketclusterClientJava_test.iml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index b73fd63..936df9c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,16 +1,17 @@ plugins { - id "com.jfrog.bintray" version "1.8.4" id 'java' } repositories { - jcenter() + mavenCentral() + google() + maven { url 'https://repo.grails.org/grails/core/' } } allprojects { tasks.withType(JavaCompile) { - sourceCompatibility = '1.7' - targetCompatibility = '1.7' + sourceCompatibility = '17' + targetCompatibility = '17' } } @@ -20,64 +21,19 @@ version '2.0.0' allprojects { repositories { - jcenter() + mavenLocal() + google() + mavenCentral() + maven { url 'https://jitpack.io' } + maven { url 'https://repo.grails.org/grails/core/' } } - apply plugin: 'java' - apply plugin: 'maven' - apply plugin: 'maven-publish' } -task sourceJar(type: Jar) { - classifier = 'sources' - from sourceSets.main.allJava -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -publishing { - publications { - MyPublication(MavenPublication) { - from components.java - groupId 'io.github.sac' - artifactId 'SocketclusterClientJava' - version this.version - - artifact sourceJar { - classifier "sources" - } - - artifact javadocJar { - classifier "javadoc" - } - } - } -} - - -bintray{ - user=System.getenv('BINTRAY_USER') - key=System.getenv('BINTRAY_API_KEY') -// configurations = ['archives'] - publications = ['MyPublication'] - pkg { - repo = 'Maven' - name = 'socketcluster-client' - licenses = ['Apache-2.0'] - vcsUrl = 'https://github.com/sacOO7/socketcluster-client-java.git' - publicDownloadNumbers = true - - version { - name = this.version - desc = 'Fixed ping pong isse in accordance with new sc release' - vcsTag = this.version - } - } +java { + withSourcesJar() } dependencies { - compile 'com.neovisionaries:nv-websocket-client:1.30' - compile group: 'org.json', name: 'json', version: '20090211' + implementation 'com.neovisionaries:nv-websocket-client:2.14' + implementation group: 'org.json', name: 'json', version: '20241224' } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d1f2564..5d4565b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Feb 06 20:50:06 IST 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip +#Mon Jan 06 13:33:35 KST 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists From 661d79016887f5b6c4f4e8e1d6ae10851f5b1fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=80=EC=9A=B4?= Date: Tue, 7 Jan 2025 09:42:06 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[Socket]=20setPingInterval,=20sendPing=20?= =?UTF-8?q?=EB=9E=98=ED=95=91=20=ED=95=A8=EC=88=98=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/io/github/sac/Socket.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/io/github/sac/Socket.java b/src/main/java/io/github/sac/Socket.java index 57d361c..0f79bf7 100644 --- a/src/main/java/io/github/sac/Socket.java +++ b/src/main/java/io/github/sac/Socket.java @@ -537,6 +537,14 @@ public void disconnect() { strategy = null; } + public void setPingInterval(long time){ + ws.setPingInterval(time); + } + + public void sendPing(){ + ws.sendPing(); + } + /** * States can be * CLOSED From 7bee939740460a06ddac714c2ffd197e881c8f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=80=EC=9A=B4?= Date: Tue, 7 Jan 2025 16:22:48 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[Socket]=20setPongInterval,=20sendPong=20?= =?UTF-8?q?=EB=9E=98=ED=95=91=20=ED=95=A8=EC=88=98=20=EC=9E=91=EC=84=B1,?= =?UTF-8?q?=20EventThread=20=EC=97=90=EC=84=9C=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=8B=A4=ED=96=89=EB=90=98=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/io/github/sac/Socket.java | 40 ++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/sac/Socket.java b/src/main/java/io/github/sac/Socket.java index 0f79bf7..f14a5bc 100644 --- a/src/main/java/io/github/sac/Socket.java +++ b/src/main/java/io/github/sac/Socket.java @@ -537,12 +537,44 @@ public void disconnect() { strategy = null; } - public void setPingInterval(long time){ - ws.setPingInterval(time); + public Socket setPingInterval(long time){ + EventThread.exec(new Runnable() { + public void run() { + ws.setPingInterval(time); + } + }); + + return this; + } + + public Socket sendPing(){ + EventThread.exec(new Runnable() { + public void run() { + ws.sendPing(); + } + }); + + return this; } - public void sendPing(){ - ws.sendPing(); + public Socket setPongInterval(long time){ + EventThread.exec(new Runnable() { + public void run() { + ws.setPongInterval(time); + } + }); + + return this; + } + + public Socket sendPong(){ + EventThread.exec(new Runnable() { + public void run() { + ws.sendPong(); + } + }); + + return this; } /**