A
Alexander Inochkin
Hi!
I'm using HttpRequestClass on .NET and .NET Compact. I made request and get
incomming data.
But data feed is very slow. But I need to get data as early as possible. But
behavior the code under
this two platform is different... On .NET I read all available bytes, less
then BUFFER_SIZE, as they come.
On .NET Compact (emulator and real device) I get BUFFER_SIZE bytes as first
result. I wait until all bytes
up to BUFFER_SIZE will be read...
How can I get behavior on .NET Compact like on .NET?
I need to get all available bytes without waiting filling all buffer....
Example of code:
HttpWebResponse resp = ...;
Stream responseStream = resp.GetResponseStream();
responseStream.BeginRead(buffer, 0, BUFFER_SIZE, new
AsyncCallback(ReadCallBack), ...);
private void ReadCallBack(IAsyncResult asyncResult)
{
...
int readCount = responseStream.EndRead( asyncResult );
}
I'm using HttpRequestClass on .NET and .NET Compact. I made request and get
incomming data.
But data feed is very slow. But I need to get data as early as possible. But
behavior the code under
this two platform is different... On .NET I read all available bytes, less
then BUFFER_SIZE, as they come.
On .NET Compact (emulator and real device) I get BUFFER_SIZE bytes as first
result. I wait until all bytes
up to BUFFER_SIZE will be read...
How can I get behavior on .NET Compact like on .NET?
I need to get all available bytes without waiting filling all buffer....
Example of code:
HttpWebResponse resp = ...;
Stream responseStream = resp.GetResponseStream();
responseStream.BeginRead(buffer, 0, BUFFER_SIZE, new
AsyncCallback(ReadCallBack), ...);
private void ReadCallBack(IAsyncResult asyncResult)
{
...
int readCount = responseStream.EndRead( asyncResult );
}