Main Site Documentation

Cobra II HttpWebRequest freeze when debugging (wireless, GetResponse)


#1

Hi.
I am using wifi on board, static IP, static DNS. Nothing is different when using dynamic IP/DNS. (I get IP when using dhcp).
The problem is, that this code always freeze when I debug program. If I reset Cobra II, I get response (Time from local PHP). My URL is: “http://192.168.1.5/Process/Microcontroler/GetDateTime.php

_request = (HttpWebRequest)HttpWebRequest.Create(url);
_request.Method = "GET";
_request.Timeout = 30 * 1000;
response = _request.GetResponse();   //here the program freeze when debugging

#2

You just run it under the debugger and it is freezes. You are not stepping through or have any breakpoints, right?


#3

Both ways freeze. Stepping over the code or just run it.
I tried 10 times today. When debugging it freeze. When not, it works.
My php code is (just in case):


<?php
	date_default_timezone_set('Europe/Ljubljana');
	echo date("Y-m-d H:i:s");
?>

#4

@ Makla - it seems that your code can’t reach the server… set the timeout… like request.ReadWriteTimeout = 5000;


#5

This is not a solution.The code must reach server when I debug the program. I must get data from server to debug what I actually want.

That also does not explain why is working when it is not in debug mode.


#6

… and use netmon to watch the network packet exchange to confirm what gets onto the network and if it looks like a valid request


#7

I installed netmon.
Appache server log did log access when debugging.
When I clicked reset, a line is added to access log:
192.168.1.201 - - [09/Mar/2013:09:19:47 +0100] “GET /Process/Microcontroler/GetDateTime.php HTTP/1.1” 200 19

The Microsoft Network monitor also did not cache any request when debugging. When I clicked reset:
138 9:19:47 9.3.2013 143.3757138 192.168.1.201 192.168.1.5 ARP ARP:Response, 192.168.1.201 at 00-23-A7-1F-9D-B1
135 9:19:47 9.3.2013 143.3105195 192.168.1.201 224.0.0.1 IGMP IGMP:IGMPv2 Membership Report {IPv4:17}

I would say expected behaviour.


#8

@ Makla - Did you install the hotfix for WiFI? http://www.tinyclr.com/forum/topic?id=11074&page=1


#9

I read about update, but didn’t think it will fix anything, because nobody mention any similar problems.
The description said:

[quote]We believe that we have finally solved the DCHP/Socket creation error with G120.
We have corrected the issue with sending and receiving data over serial simultaneously. [/quote]
Nothing describes my problem.

Thanks.