I'm having a strange problem on a Linux platform (bit like the one reported here)
I've been using Chilkat for quite some time now and this is the first time I've come across anything I can't solve myself. I'm using code that's pretty much straight out of the examples (to preclude any typing errors on my part) but I can't seem to get this to work on a Linux platform although (uncharacteristically) it works perfectly on Windows.
I'm writing a test harness for an Android App. I need to connect to the app from a remote device over WiFi and exchange some data. However, I'm finding I get a positive response from "connect" (CkSocket) even when the remote device is turned off!! I've got the latest libraries (as far as I know) and I've got all the error logging on:
Here's the trace:
The IP addresses are correct (and I can't ping 192.168.168.106 when the tablet is turned off so I don't think it's a duplicate address.
I've checked the documentation connect(2) and it looks to me that it should return ECONNREFUSED or ENETUNREACH.
However, as soon as I do a receive I get:
It looks to me like this connection is behaving like a UDP rather than a TCP socket but I can't find anything in the C++ component method/parameter list that changes this behaviour. I haven't done a Wireshark trace on it yet though to confirm the latter; I'm running it in a VM and w/shark seems to have a problem with the adapter.
For the record though, here's the code:
Anyone got any ideas?
This question is marked "community wiki".
asked Aug 13 '13 at 10:38
It certainly is a mystery. Information about the socket family, type, and protocol are included in the LastErrorText, so it's certainly not trying to use UDP:
AddrInfoList: AddrInfo: ai_flags: 1028 ai_family: 2 (This is AF_INET) ai_socktype: 1 (This is SOCK_STREAM) ai_protocol: 6 (This is IPPROTO_TCP) ai_addrlen: 16 ai_canonname: (NULL) --AddrInfo --AddrInfoListUnfortunately, I don't have any good answer for it..
answered Aug 14 '13 at 17:23
After a quick Google search, I found this: http://stackoverflow.com/questions/7905505/android-socket-java-net-socketexception-no-route-to-host
answered Aug 14 '13 at 17:25