TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.
http://tootallnate.github.io/Java-WebSocket
MIT License
10.53k stars 2.58k forks source link

Systematic "RSV n" errors with stochastic "n"s #430

Closed ComradeWoland closed 7 years ago

ComradeWoland commented 7 years ago

Hello, comrades! There are errors "RSV n" with stochastic "n"s detected. The WebSocket server is a small chat engine, available via wss: connection. It works with some stable periods, intermediated with periods of "RSV n" errors sent to stderr.

WTF may be this?


org.java_websocket.exceptions.InvalidFrameException: bad rsv 2
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 2
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 2
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 5
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 3
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 1
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 1
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 1
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 1
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: unknow optcode 3
    at org.java_websocket.drafts.Draft_10.toOpcode(Draft_10.java:239)
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:313)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: unknow optcode 4
    at org.java_websocket.drafts.Draft_10.toOpcode(Draft_10.java:239)
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:313)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 7
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 7
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 2
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.WebsocketNotConnectedException
    at org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:566)
    at org.java_websocket.WebSocketImpl.send(WebSocketImpl.java:543)
    at com.webrtcexample.signaler.Client.sendQuestion(Client.java:308)
    at com.webrtcexample.signaler.Client.pushQuestion(Client.java:107)
    at com.webrtcexample.signaler.Room.skip(Room.java:29)
    at com.webrtcexample.signaler.Main.onClose(Main.java:360)
    at org.java_websocket.server.WebSocketServer.onWebsocketClose(WebSocketServer.java:489)
    at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:459)
    at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:479)
    at org.java_websocket.SocketChannelIOHelper.batch(SocketChannelIOHelper.java:64)
    at org.java_websocket.server.WebSocketServer.run(WebSocketServer.java:349)
    at java.lang.Thread.run(Thread.java:745)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:160)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
org.java_websocket.exceptions.InvalidFrameException: bad rsv 3
    at org.java_websocket.drafts.Draft_10.translateSingleFrame(Draft_10.java:309)
    at org.java_websocket.drafts.Draft_10.translateFrame(Draft_10.java:286)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:312)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:157)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)

Also following errors were detected



java.nio.InvalidMarkException
    at java.nio.Buffer.reset(Buffer.java:306)
    at org.java_websocket.WebSocketImpl.decodeHandshake(WebSocketImpl.java:287)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:159)
    at org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:657)
java.nio.channels.ClosedByInterruptException
    at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:478)
    at org.java_websocket.SSLSocketChannel2.write(SSLSocketChannel2.java:195)
    at org.java_websocket.SocketChannelIOHelper.batch(SocketChannelIOHelper.java:52)
    at org.java_websocket.server.WebSocketServer.run(WebSocketServer.java:349)
    at java.lang.Thread.run(Thread.java:745)
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@16259ff9 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@4119c2[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 2]
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
    at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:326)
    at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
    at java.util.concurrent.ScheduledThreadPoolExecutor.submit(ScheduledThreadPoolExecutor.java:632)
    at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:678)
    at org.java_websocket.SSLSocketChannel2.consumeDelegatedTasks(SSLSocketChannel2.java:176)
    at org.java_websocket.SSLSocketChannel2.processHandshake(SSLSocketChannel2.java:141)
    at org.java_websocket.SSLSocketChannel2.write(SSLSocketChannel2.java:208)
    at org.java_websocket.SSLSocketChannel2.writeMore(SSLSocketChannel2.java:351)
    at org.java_websocket.SocketChannelIOHelper.batch(SocketChannelIOHelper.java:49)
    at org.java_websocket.server.WebSocketServer.run(WebSocketServer.java:344)
    at java.lang.Thread.run(Thread.java:745)
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@4119c2 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@243a3eac[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 2]
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
    at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:326)
    at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:533)
    at java.util.concurrent.ScheduledThreadPoolExecutor.submit(ScheduledThreadPoolExecutor.java:632)
    at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:678)
    at org.java_websocket.SSLSocketChannel2.consumeDelegatedTasks(SSLSocketChannel2.java:176)
    at org.java_websocket.SSLSocketChannel2.processHandshake(SSLSocketChannel2.java:141)
    at org.java_websocket.SSLSocketChannel2.write(SSLSocketChannel2.java:208)
    at org.java_websocket.SSLSocketChannel2.writeMore(SSLSocketChannel2.java:351)
    at org.java_websocket.SocketChannelIOHelper.batch(SocketChannelIOHelper.java:49)
    at org.java_websocket.server.WebSocketServer.run(WebSocketServer.java:344)
    at java.lang.Thread.run(Thread.java:745)

```------------------------------------------------
marci4 commented 7 years ago

Hey @ComradeWoland, what client are you using?

Could it be that you are using a .NET client?

Greetings marci4

ComradeWoland commented 7 years ago

No, man, this bug appears while Google Chrome (latest version) connects to my WSS server. My app uses WSS to support WebRTC connection establishing and text messaging inside Video chat roulette, but connection sometimes unstable, and server log is full of bugs.

marci4 commented 7 years ago

Hey @ComradeWoland,

could you please activate the debug output with WebSocketImpl.DEBUG = true;

I cannot reproduce this problem with my private project right now (nether wss nor ws) Maybe you could also try rebuild the jar directly from the sources here on github (I merged some pull requests, but was not able to update maven/gradle yet)

Also I just got the idea that you maybe wanna use Draft17 and not Draft10 for your project (Read up on the drafts here), because as documented it implements Hybi 17/RFC 6455 and is currently supported by Chrome16+ and IE10.

Greetings marci4

micamo2k17 commented 7 years ago

Hi,

same error here. In my case it's always "bad rsv 3", seems to appear at random moments, but quite often. Didn't have this problem when using WS instead of WSS.

Thank you for any indication.

marci4 commented 7 years ago

Hello @micamo2k17,

could you please activate the debug output with WebSocketImpl.DEBUG = true; before you start the websocket server and then post the log here please.

When does this problem occur?

Right now I don't have any problems using a wss in production.

Greetings marci4

micamo2k17 commented 7 years ago

Hi @marci4

I activated debug mode. The following are two cases of that error (one with debug off, one on). As you can see, the number following "bad rsv" actually changes also in my case:

Without WebSocketImpl.DEBUG = true;

E/SERVICE: WebSocket did fail with error: org.java_websocket.exceptions.InvalidFrameException: bad rsv 1
D/WSServer: onError: org.java_websocket.exceptions.InvalidFrameException: bad rsv 1
W/SERVICE: WebSocket closed

With WebSocketImpl.DEBUG = true;

E/SERVICE: WebSocket did fail with error: org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
D/WSServer: onError: org.java_websocket.exceptions.InvalidFrameException: bad rsv 4
I/System.out: send frame: Framedata{ optcode:CLOSING, fin:true, payloadlength:11, payload:[3, -17, -65, -67, 98, 97, 100, 32, 114, 115, 118, 32, 52]}code: 1002
I/System.out: write(13): {��bad rsv 4}
W/SERVICE: WebSocket closed

Trying to answer to your questions:

Thanks for your help!

marci4 commented 7 years ago

Hello @micamo2k17

first of all it looks like you are using an outdated version of the lib (Check the readme for the latest version)

Maybe this fixes your issue already.

If not please also include the debug print out when the connection is opened :)

Greetings marci4

micamo2k17 commented 7 years ago

Hi @marci4

I couldn't find a readme for a newest version of the lib. Tried 1.3.1 (I saw it from the available branches/tags list) but the dependency could not be resolved. However, when the connection is opened, the following is logged: I/System.out: open using draft: Draft_17 So I believe we're using the updated build.

Thanks

marci4 commented 7 years ago

Hello @micamo2k17,

that is not an indication that you are using the latest build. It looks like you are actually using a outdated version.

How do you build your project? What do you use? Maven, Gradle?

Greetings marci4

micamo2k17 commented 7 years ago

Hi @marci4

I'm using gradle. How can I select a new version?

Thank you!

marci4 commented 7 years ago

Hello @micamo2k17

please add a custom maven repository to your repositories list maven { url "http://clojars.org/repo" }

The result may look like this

repositories { mavenCentral() maven { url "http://clojars.org/repo" } }

For compiling just add compile "org.java-websocket:java-websocket:1.3.2" so you are using the latest version.

Greetings marci4

micamo2k17 commented 7 years ago

Hi @marci4

Just tried that, doesn't seem to resolve the dependency either: Error:Failed to resolve: org.java-websocket:java-websocket:1.3.2

Regards, micamo1k2017

marci4 commented 7 years ago

Hello @micamo2k17 could you maybe join the IRC Server here http://webchat.freenode.net/?channels=java-websocket

I quess it will be easier for both of us to fix this :)

Greetings marci4

micamo2k17 commented 7 years ago

Ok, I'm logged in as micamo2k17. Thanks.

micamo2k17 commented 7 years ago

Hi @marci4

version 1.3.2 seems to solve the issue (no more errors thrown even in high-messages-rate situations)! I would now like to get back using the library retrieved via repository, rather than a JAR...

Thanks,

micamo2k17

marci4 commented 7 years ago

hello @micamo2k17

I installed the android studio again on my laptop and this works for me

apply plugin: 'com.android.library'

repositories {
    maven { url 'http://clojars.org/repo' }
}

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"

    defaultConfig {
        minSdkVersion 17
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.0'
    compile 'org.java-websocket:java-websocket:1.3.2'
    compile 'org.apache.commons:commons-lang3:3.0'
    compile 'commons-codec:commons-codec:1.9'
    compile 'commons-io:commons-io:2.4'
    compile 'com.android.support:support-v4:25.3.0'
    testCompile 'junit:junit:4.12'
    //compile files('libs/commons-codec-1.3.jar')
}

so everything fixed itself with the following line repositories { maven { url 'http://clojars.org/repo' } }

Greetings marci4

micamo2k17 commented 7 years ago

Hi @marci4

I figured out where my problem was: I'm using the library inside a custom library. I simply was not referring to the repository in the app that integrates my library, but just in my library's gradle.

Any clue about the timing of a possible "promotion" of version 1.3.2 to the master/official branch?

Thanks!

Michele

marci4 commented 7 years ago

Hello @micamo2k17,

TooTallNate did not have any access to the maven repository so the clojars repository is now gonna be the main repository... Can't do much there...

Closing the issue since it is resolved with the latest version.

Greetings marci4

ComradeWoland commented 7 years ago

Hey, people! Huge sorries, i was some deep ill. But LOGS has been collected during this time.

Here two pieces of them. error.log and standard log files error.log.txt log.txt

Std. Log is much more bigger by size,and cutted at more early point

marci4 commented 7 years ago

Hello @ComradeWoland,

hope you feel better now!

Could it be that you are not using the current version 1.3.3?

Greetings marci4