Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

java.net.SocketTimeoutException

$
0
0

Hi, I've been working with titanium and webservices for some time now, but I just got stuck in this bug were I cant understand exactly whats happening.

I'm using the latest titanium version developing for android and working on local network with a physical device. My notebook is hosting the webservice and providing internet connection for the mobile device with a virtual network ad-hoc on windows 8.

I haven't got any communication problems until now.

I've been importing and exporting data in json format, but since I try to return this particular section of json the connection start returning an java.netSocketTimeoutException. If I remove that section the app works fine and I can trade data between webservice and the app normally. If I call the same webservice via browser everything seems fine.

I'm using a plugin with chrome that allows me to beautify the json. But even if grab the json source and validate it through a website everything looks fine. So I believe this problem must be related with titanium.

The crash occurs after I call

var xhr = Ti.Network.createHTTPClient();
xhr.setTimeout(10000);  /* in milliseconds */
...
xhr.onload= function(e) {...}
xhr.onerror= function(e) {...}
...
xhr.send();
Is there any to fetch more error information? I cant use fiddler because it wont capture local network. right now I'm using this
xhr.onerror= function(e) {
        Ti.API.info('error, HTTP status = ' + this.status);
        Ti.App.fireEvent('mainActivityBar', { hide: "true" });
        alert("Connection failed:" + e.error);
    };
the json is very simple and its automatically generated by the wcf webservice from an object

my guess is that I'm not being able to parse that section of JSON from app side(?) any ideas what I should try next?


Viewing all articles
Browse latest Browse all 8068

Trending Articles