11-03-2009 10:55 AM
Am using storm device.
I got this error "Tunnel Failed" when i try to run establish the http connection. i searched through the forums and am tired but i didnt find any solution,
this is my code snippet...
HttpConnection conn = (HttpConnection) Connector.open("http://server/BBBI/Default.aspx?Ca tegoryName=abc&Item=789&Quantity=10;interface = wifi");
inputstream = conn.openDataInputStream();
In simulator it is working fine. But coming to device it is not working and am thrown into deep trouble. plz somebody help me. i gone through the threads in the forums but no luck, yet!!!!!
I tried to run the HTTPDemo also, but it is also not working giving the same error.
11-03-2009 11:04 AM
I suggest you drop the spaces around the '=' in the interface=wifi. It should be "...;interface=wifi".
11-03-2009 11:36 AM
ya i tried with that but no luck, even in the simulator it is giving tunnelfailed exception. It is not working in the simulator even!!!!
HttpConnection conn = (HttpConnection) Connector.open("http://server/iphone/getCategories .php;interface=wifi");
11-03-2009 11:45 AM
Is the server local or remote to the device? If local, is its name resolvable using DNS? What happens if you use the local IP address for the server instead of the name?
11-03-2009 12:51 PM
OK. Try appending ";deviceside=true" to the URL just to make sure. So, "...;interface=wifi;deviceside=true". Not sure if it'll help though.
11-03-2009 01:37 PM - last edited on 11-03-2009 05:26 PM
Correction: "interface=wifi" is supported on SImulators for devices that support wifi. I'm hoping klyubin will post the instructions, which I have just used to enable it.
I originally said it was not, which prompted the following posts.
Also you should not add ";deviceside=true" to ";interface=wifi". There is no need to and I think it is potentially dangerous, because I suspect that some of the device's connection processing will pick up on ";deviceside=true" and will attempt to use wireless rather than WiFi processing. This will give you a tunnel failure.
Finally, but possibly most importantly, if you are not using Storm 2, you don't have WiFi - and that probably explains the tunnel failure - it is trying direct TCP.
If you have got a Storm 2, what do you think of it.
11-03-2009 01:44 PM
peter_strange, interface=wifi is not just supported on many simulators (e.g, the Bold 9000 or Curve 8900 to name a few), but actually works as expected (connections go via the simulated WiFi network, as opposed to the simulater cellular network). Are you talking about a particular simulator where interface=wifi is not supported?
11-03-2009 01:46 PM
P.S. I can also confirm that the deviceside=true + interface=wifi combo works just fine on simulators that support WiFi and on devices that support WiFi.
11-03-2009 01:56 PM - last edited on 11-03-2009 02:01 PM
Thanks for updating this klyubin. I will correct my post regarding wifi in Simulators once I've done some testing. I was sure I had tested it and it didn't work, but that was a long time ago with the first WiFi devices (8320 etc).
I still stand by the comment about not using ";deviceside=true" on the real devices, I would not code it, regardless of whether it works or not. I think I have tested on all WiFi enabled devices, and ";interface=wifi" by itself, works on them all.
11-03-2009 02:03 PM - last edited on 11-03-2009 02:06 PM
peter_strange, I'm curious whether there is a particular reason why you don't like the interface=wifi and deviceside=true combination? I'm not aware of any clear documentation on whether this combination is allowed. At the same time I don't recall any definitive documentation about interface=wifi. Does interface=wifi mean IP over WiFi, or does it just mean that whatever the connection type is requested using other paramers (e.g., MDS, BIS-B, Direct TCP) should be routed via WiFI (there's interface=cellular too!)? I personally have favoured the second explanation, which leads to deviceside=true + interface=wifi, just to make sure it's device-generated TCP/IP or UDP/IP over WiFi.