StompProtocolAndroid icon indicating copy to clipboard operation
StompProtocolAndroid copied to clipboard

connected closed

Open jingzhanwu opened this issue 7 years ago • 4 comments

Download your demo running test on github and the background service has been tuned, but Call the following method has been prompt “Stomp connection closed”,It's the same error as HTTP。 What caused it?

public void connectStomp(View view) { mStompClient = Stomp.over(WebSocket.class, "ws://192.168.0.100:9050/msg-websocket"); mStompClient.lifecycle() .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(lifecycleEvent -> { switch (lifecycleEvent.getType()) { case OPENED: toast("Stomp connection opened"); break; case ERROR: Log.e(TAG, "Stomp connection error", lifecycleEvent.getException()); toast("Stomp connection error"); break; case CLOSED: toast("Stomp connection closed"); } });

    mStompClient.topic("/message/broadcastMsg")
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(topicMessage -> {
                Log.d(TAG, "Received " + topicMessage.getPayload());
                addItem(mGson.fromJson(topicMessage.getPayload(), EchoModel.class));
            });
    mStompClient.connect();

}

jingzhanwu avatar Jan 03 '18 07:01 jingzhanwu

Can you post your log?

forresthopkinsa avatar Jan 04 '18 00:01 forresthopkinsa

Background use spring boot - websocket, below is the android I print the log

01-04 09:35:09.515 4660-4660/ua.naiksoftware.stompclientexample I/art: Late-enabling -Xcheck:jni 01-04 09:35:09.515 4660-4660/ua.naiksoftware.stompclientexample I/art: Reinit property: dalvik.vm.checkjni= false 01-04 09:35:09.543 4660-4660/ua.naiksoftware.stompclientexample W/System: ClassLoader referenced unknown path: /data/app/ua.naiksoftware.stompclientexample-2/lib/arm64 01-04 09:35:09.558 4660-4660/ua.naiksoftware.stompclientexample I/HwCust: Constructor found for class android.app.HwCustActivityImpl 01-04 09:35:09.565 4660-4660/ua.naiksoftware.stompclientexample I/HwCust: Constructor found for class android.app.HwCustHwWallpaperManagerImpl 01-04 09:35:09.572 4660-4660/ua.naiksoftware.stompclientexample W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 01-04 09:35:09.602 4660-4667/ua.naiksoftware.stompclientexample I/art: Debugger is no longer active 01-04 09:35:09.602 4660-4667/ua.naiksoftware.stompclientexample I/art: Starting a blocking GC Instrumentation 01-04 09:35:09.666 4660-4691/ua.naiksoftware.stompclientexample I/OpenGLRenderer: Initialized EGL, version 1.4 01-04 09:35:09.672 4660-4691/ua.naiksoftware.stompclientexample W/linker: /vendor/lib64/libhwuibp.so: unused DT entry: type 0xf arg 0xe3a 01-04 09:35:09.683 4660-4691/ua.naiksoftware.stompclientexample E/OpenGLRenderer: allen debug liyu Key: 0 01-04 09:35:09.686 4660-4691/ua.naiksoftware.stompclientexample E/OpenGLRenderer: allen debug liyu Key: 34359738371 01-04 09:35:09.687 4660-4691/ua.naiksoftware.stompclientexample E/OpenGLRenderer: allen debug liyu Key: 240518168576 01-04 09:35:22.967 4660-4660/ua.naiksoftware.stompclientexample I/hwaps: JNI_OnLoad 01-04 09:35:23.030 4660-4691/ua.naiksoftware.stompclientexample E/OpenGLRenderer: allen debug liyu Key: 103084458052 01-04 09:35:23.166 4660-4660/ua.naiksoftware.stompclientexample I/MainActivity: Stomp connection closed 01-04 09:35:23.280 4660-4691/ua.naiksoftware.stompclientexample E/OpenGLRenderer: allen debug liyu Key: 1

jingzhanwu avatar Jan 04 '18 01:01 jingzhanwu

I have the same problem

bishi2016 avatar Jan 24 '18 11:01 bishi2016

me too,the connect closed after 2minitues

petma avatar Jun 24 '18 01:06 petma