So I am trying to figure out what exactly is wrong with my code. I am trying to connect to a server and I wrote some code in java using netty. It does not work in java on my pc (not work as in, the connection gets refused). However, when I run it on my phone by just pasting the code in an android studio project it works completely fine. I think there is some kind of difference in the underlying socket connection / difference in the OS but I am not sure what exactly. Anyone who can help me figure it out perhaps?
#What am I missing in my netty code
24 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @vague widget! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
share code
I'll share when I am able to. I however doubt there's much to find in the code that is broken since the code is exactly the same in the android app and works fine
you might be surprised!
How to share larger pieces of code?
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I haven't provided some classes with it since they only contain simple things like username and password and such. Just data
what are you setting as host, port
Somewhere in the US. The connection does not fail. It just gets refused. As if it recognises that the connection is from java and not a phone or something
show stack trace of failure?
Where can I find that?
when connection fails you would get some kind of error right?
Ah like that. No, the connection itself succeeds. After that the server tells me that the connection is not allowed (for whatever reason) similar to a 403 I guess. This however does not happen when I run the exact same code on my phone? That is what I am trying to figure out
And that is why I suspect there might be an underlying difference between the two which I am not aware of
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
Beep
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
Reopen