You're logging both port and localport which suggests that you might be getting them mixed up.
Is there a way to confirm I'm using a local port? I obtained that port number by first setting server code port number to '0',
so it generated a random local port number. I then fed that back as local port number. Is this a correct means of obtaining a local port number?
Also, change the code to ensure your timeout is at least 3 or 4 seconds, and see how it goes.
Ah, I don't know a code line that would let me do this, i even scrolled through to the advice you gave in the chatroom but still didn't get it because there is no construct in the client code and the client runs inside Android class not with Android class, so FSendfileActivity constructor wouldn't have api to change the client timeout
All I'm suggesting in this case is to take what you already have,
use a different constructor, then make the explicit connect call on the next line:
................
The timeout should at least let you get to the next line of logging, and confirm that the system is
at least trying the connection
I'm sure i'm missing something so 'would be glad if you could elaborate further
I would be more worried that the Android client is not on the same network as the server (or is not being routed to the server.)
Run the client code on the same machine as the server, and see how it goes.
Also, run Wireshark on the server, looking for packets on port 52059, and see what shows up when you start the client.
Ok i should run both in Java, I will try... wait if i'm running 2 Java programs at the same time, in the same IDE, never tried that before, but wouldn't there be an exception ,.... a crash?
Also , my novice-ness is laid bare again, because i never heard of Wireshark program before. But thats what googling is there for ...so i will take a moment to check this and see how to do this
That's a good point, actually. The Android code could be connected to (a) the telecommunications provider network, (b) the home WiFi, or (c) the emulator context. In the first case, it can't connect to a locally hosted server at all. In the second case it should be okay. And in the 3rd case it seems to be a bit more complex, but is probably okay if it's not attempting to connect to localhost, if I remember correctly.
There is zero network data on the phone so I can guarantee they are both on router wifi
Many thanks @Kylotan and @hplu0603