-
Notifications
You must be signed in to change notification settings - Fork 25
[WebSocket] get the nvmWebsocket instance #79
Comments
I don't actively develop my LibGDX utilities lately, but I'll look into before the next release. If this issue blocks you, your best bet is to fork the library and add the method yourself - it's a very simple getter. There's no reason for reflection to fail to fetch the field value either, can you show me the code? |
thank you for your quick answer ! `
but I found in AndroidLauncher.java, when I call CommonWebSocket.iniate(); it return a new nvWebSocket by a factory, and there I tryed the reflexion but has I don' tknow exactly what to do i'm a bit lost.. I can indeed get the source code and modify by my own but I try to understand exactly how your lib work, I mean how exactly you do the bridge between nvWebSocket and platform WS Implementation |
This is the line where a new web socket is created - you probably want to add your extra settings there. |
ok thank you, So i just need to clone this github repo as usual and import it as a classic java project, is that right ? |
You could do that, but you'll find it easier to create a Java file with the same package and name in your project to patch the library. I remember doing it for some LibGDX classes back when I was starting as well - the compiler/build tool seems to prefer files from your project over the third-party libraries, so as long as you keep the same name and do not modify the publicly used interface, you should be fine.
|
Ok thank you again and again for your help and patience; I've create package as you described in my android project, added a the new java class into it but I got an error on Line 27 on NvWebSocketLister(this) and when I import it ( import com.github.czyzby.websocket.impl.NvWebSocketListener;) it say that the constructor doesnt accept this type of object : |
You made a typo. It's |
By the way, you should try using IntelliJ/Android Studio instead of Eclipse - especially if you plan on releasing a mobile version. |
YEA ! thank you the error disappear !! |
ok this work on desktop.
|
That's because both you and The alternative is to clone this repo, modify the library source and publish the lib to your Maven Local with |
ok czyzby thank you, I will try this today ! |
Hello, If i understand correctly, my best bet is to clone this repo, made my change, build the new project into a jar file and then in the build.gradle file compile fileTree(dir: 'libs', include: '*.jar'). I read this usefull article : https://github.com/libgdx/libgdx/wiki/Dependency-management-with-Gradle#mavenizing-local-dependencies So what is the best solution ? |
When you clone the repository, you can execute Make sure to add mavenLocal() to your repositories and then you can just add your custom modified library with: compile "com.github.czyzby:gdx-websocket-common:1.2.3-YOUR_VERSION" |
Hello,
I need to get the underlying nvWebSocket instance when I create a websocket via ExtendedNet.createnewWebsocket
I tryed via reflexion to get the instance but it failed.
All I wanted to do is to get the websocket object platform depends to simply change the tcpNoDelay flag on my desktop and android app
Issue related to this : TakahikoKawasaki/nv-websocket-client#141
Thank you.
The text was updated successfully, but these errors were encountered: