[maemo-developers] [maemo-developers] HttpWebRequest in C#/Mono on N770 : The request timed out

From: marc.pub marc.pub at monbureau.com
Date: Sun Jan 22 01:04:11 EET 2006
Hi,
Thanks for your help,

I have tried the two following batch file

#!/bin/sh
export LD_PRELOAD=/usr/lib/libosso-ic-preload.so
/home/user/mono/mono-nokia/mono WebFetch.exe

#!/bin/sh
source /usr/bin/connectivity_preload.sh
/home/user/mono/mono-nokia/mono WebFetch.exe


But nothing change: no screen to initiate a connection and nothing append if
I start manually a connection. Just the time out exception:

Unhandled Exception: System.Net.WebException: The request timed out
in <0x001b4> System.Net.HttpWebRequest:EndGetResponse (IAsyncResult
asyncResult)
in <0x0007b> System.Net.HttpWebRequest:GetResponse ()
in <0x0017f> WebFetch:Main (System.String[] args)

Is someone succeeding in using http in mono environment on the N770?

Regards,
Marc Bordessoule.





-----Message d'origine-----
De : Devesh Kothari [mailto:devesh.kothari at nokia.com] 
Envoyé : vendredi 20 janvier 2006 11:25
À : ext marc.pub
Cc : maemo-developers at maemo.org
Objet : Re: [maemo-developers] HttpWebRequest in C#/Mono on N770 : The
request timed out

ext marc.pub wrote:

> Hello,
>
> I try to access Internet in a C# / mono program with the
> HttpWebRequest class on my Nokia 770. See my program WebFetch below.
>
> When I execute the program it wait one minute at the
> HttpWebRequest.GetResponse(); method and exit with a time out. See my
> log below.
>
> With the use of TcpDump I found that there is no exchange of data.
>
> The program is not asking to initiate a new wifi connection
>
> The behaviour is the same if the connection is active or not.
>
> I can access the same url with the opera navigator in the same time.
>
> I use the mono environment that I found at
> http://www.mono-project.com/Mono:ARM. I believe it is the 1.1.9 mono
> release.
>
> I compiled the program (.exe) on Linux Ubuntu I386 with the 1.1.9 mono
> Release.
>
> Is someone succeeding with httpConnection and mono for the N770?
>
> Maybe I should 'activate' the connection specifically for mono before
> using HttpWebRequest class? But how to do?
>
Use the LD_PRELOAD

export LD_PRELOAD=/usr/lib/libosso-ic-preload.so;

in shell script, before launching your app.
I dont know how that would work out in mono scenario, I am assuming that
mono runtime or whatever would finally 
try to make socket calls 


give it a shot
cheers
Devesh

> Any idea?
>
> Regards,
>
> Marc Bordessoule.
>
> ---- Exec log --------
>
> ~/mono/mono-nokia $ ./mono WebFetch.exe
>
> WebRequest.Create...
>
> Execute the request...
>
> Unhandled Exception: System.Net.WebException: The request timed out
>
> in <0x001b4> System.Net.HttpWebRequest:EndGetResponse (IAsyncResult
> asyncResult)
>
> in <0x0007b> System.Net.HttpWebRequest:GetResponse ()
>
> in <0x0017f> WebFetch:Main (System.String[] args)
>
> ~/mono/mono-nokia $
>
> ------ WebFetch.cs --------------------
>
> 

>
> class WebFetch
>
> {
>
> static void Main(string[] args)
>
> {
>
> StringBuilder sb = new StringBuilder();
>
> byte[] buf = new byte[8192];
>
> Console.WriteLine ("\nWebRequest.Create...");
>
> HttpWebRequest request = (HttpWebRequest)
> WebRequest.Create("http://www.monbureau.com");
>
> Console.WriteLine ("\nExecute the request...");
>
> HttpWebResponse response = (HttpWebResponse) request.GetResponse();
>
> Console.WriteLine ("\nRead data...");
>
> Stream resStream = response.GetResponseStream();
>
> string tempString = null;
>
> int count = 0;
>
> do
>
> {
>
> count = resStream.Read(buf, 0, buf.Length);
>
> if (count != 0)
>
> {
>
> tempString = Encoding.ASCII.GetString(buf, 0, count);
>
> sb.Append(tempString);
>
> }
>
> }
>
> while (count > 0);
>
> Console.WriteLine(sb.ToString());
>
> Console.WriteLine ("\nEnd.");
>
> }
>
> }
>
>------------------------------------------------------------------------
>
>_______________________________________________
>maemo-developers mailing list
>maemo-developers at maemo.org
>https://maemo.org/mailman/listinfo/maemo-developers
>  
>



More information about the maemo-developers mailing list