tags:

views:

10

answers:

0

Hi, I am developing a Windows Mobile 6 application on the .Net Compact framework 2 platform. I am trying to develop a http client which communicates with a normal tcp server. When I open the request stream with

HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://10.108.10.57:8001/");

System.Net.ServicePointManager.Expect100Continue = false;

    wr.Method = "POST";
    wr.KeepAlive = true;
    wr.Pipelined = true;
    wr.SendChunked = true;
    wr.AllowWriteStreamBuffering = false;

    string data = "hello this is some test data";
    byte[] bA = Encoding.UTF8.GetBytes(data);
    wr.ContentType = "application/x-www-form-urlencoded";
    //wr.ContentLength = 0;

    Stream ds = wr.GetRequestStream();
    ds.Write(bA, 0, bA.Length);
    ds.Flush();
    ds.Close();

I see on my server multiple copies of the same HTTP request with headers coming again and again upto 6 times with some time interval between them, and then it stops. Whereas, when I use the same code with complete .Net framework only one request comes.

I also notice that when I try to access my server with PocketIE similar thing happens and six copies of httprequest come one by one. But, when using the Desktop IE, only one copy of the request is received.

Also, when issuing the multiple requests in chunked encoding, windows mobile adds up the previous request sent to the new chunk and then sends it, thus the actual sent request chunk grows additively. This behavior is not shown when using the complete .Net framework platform.

Thanks in advance for help.

Ashish