-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No errors, but data not sent with TCP #81
Comments
I think you're on the right track. The TCP implementation automatically creates a connection when you call Off hand, I'm not sure why the message isn't being delivered. As a troubleshooting step, have you tried your same code on desktop? |
Thanks for the reply! Do you mean build the app for Windows or Linux? I don't think that's possible with an app built with the Android SDK. I only know how to build Android and iOS apps. (I'm using sammyOSCKit for the iOS version of this app.) I did try running the app in the Android emulator on my Mac, but the device discovery doesn't work there, so that would be a different thing to troubleshoot. I also set up the app to send data to its own OSCPortIn, but it doesn't receive any data it sends. It does receive data sent from the iOS app, so I know the receive part is working. I've been testing it on an Android 13 tablet, but just tried on an older Android 8 tablet with the same results. BTW, when adding breakpoints to the source code to see how far the send process gets, I could go as far as ByteArrayListBytesReceiver.writeTo(), but the next step is OutputStream.write() in a java.io class. Android Studio lets me view the source for that class and add a breakpoint to it, but it doesn't stop on the breakpoint. I think that indicates that breakpoints don't reliably work in decompiled SDK classes, not that that function isn't called. However, after adding breakpoints to the decompiled java.net.Socket class, I'm now seeing an error in the getOutputStream() function whenever I try sending data: "Cannot find local variable 'impl'". This is triggered by the line |
Me no Android .. someone else needs to step-up, I am afraid. |
I'm trying to integrate JavaOSC into an Android (Kotlin) app. I need to use TCP, so I downloaded the current version of the source code but rolled back first change in 2cbbc43 so it would run on Android. Here's my code to connect to a server and send some data:
For testing, I'm sending to the OSCSmith app on my Mac. That shows the Android app connecting and then disconnecting in the same second, but it doesn't show any data received. However, I can add breakpoints to the source code and see that it's getting all the way to ByteArrayListBytesReceiver.writeTo(), and the data there is correct. I don't know why the OutputStream from that point isn't delivering the data to the server.
If I change the network protocol to UDP and leave all the other code the same, the data is sent as expected. (OSCSmith can receive on TCP or UDP and with TCP can receive SLIP or PLH format. I have it set to PLH because it sounds like JavaOSC doesn't support SLIP yet.)
I think the connection and immediate disconnection is expected, because a comment in TCPTransport.send() says, "Closing the output stream is necessary...." I can't find what part of the code triggers the disconnection, but when I add a breakpoint at the end of ByteArrayListBytesReceiver.writeTo(), I can see that the disconnect doesn't happen until after all the data is written.
I'm not getting any errors in the Android Studio console. It's like the data is just disappearing. Can anyone, perhaps @daveyarwood, who added TCP compatibility, give any insight on this?
The text was updated successfully, but these errors were encountered: