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 diff --git a/src/main/java/io/github/sac/Socket.java b/src/main/java/io/github/sac/Socket.java index 57d361c..f14a5bc 100644 --- a/src/main/java/io/github/sac/Socket.java +++ b/src/main/java/io/github/sac/Socket.java @@ -537,6 +537,46 @@ public void disconnect() { strategy = null; } + 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 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; + } + /** * States can be * CLOSED