Re: Socket recv() question?



0) Assuming the following variables

SOCKET s;
timeval timeout;

1) First, create a descriptor

fd_set fd;

2) Initialize it

fd.fd_array[0] = s;
fd.fd_count = 1;

3) Configure tx timeout

select(0, NULL, &fd, NULL, &timeout);

4) Configure rx timeout

select(0, &fd, NULL, NULL, &timeout);


"Vin" <Vin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:001E0DB9-956B-4E2A-B5D9-AB1F49C213DC@xxxxxxxxxxxxxxxx
Hi Thanks for the advice.

Yes I looked at the return code and it was normal. The most data that I
can
receive it 32kb that's all. Is there something I am doing wrong?

by the way, how do you use the select to change the time out? I have never
done it before. Can you send me more info on this or a code snippet?

thanks

"Richard Plante" wrote:

Did you look at the return code when exiting your loop that omnly
retrieves
32Kb of data? It could be a timeout problem; in that case I would
consider
increasing the timeout using the select method on the socket descriptor.

"Vin" <Vin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1E552903-CD74-485D-8293-C117D7255E39@xxxxxxxxxxxxxxxx
Sorry, I am using Embedded visual c++ 4.0 ( NOT ce 3.0)

thanks

"Vin" wrote:

Hi,

I am developing an application using Embedded visual c++ (wince 3.0)
using
sockets to send binary data from a pc to Pocket PC.

The PC is set to send 1.4mb through the socket, but the Pocket PC is
only
receive 32kb at a time within the while loop

for example:
while(moreData)
{
moreData = recv(s, buf, len, 0);
}

OK, is there anything I can do to improve this 32kb of data on the
socket?
Why so low? Is it possible to increase it from 32kb to at least 1mb?

I am trying to transfer some data at least 1.5 mb from the PC to the
Pocket
PC.

Is there any other way to achieve this?

Please give me some ideas. Many thanks





.



Relevant Pages

  • Re: Socket recv() question?
    ... You might be doing something crazy, writing the data to the file one byte at ... socket function correctly? ... How come when I use the IE on the Pocket PC and started IIS on my PC. ... Configure tx timeout ...
    (microsoft.public.windowsce.app.development)
  • Re: Socket recv() question?
    ... How come when I use the IE on the Pocket PC and started IIS on my PC. ... in a single packet, either. ... SOCKET s; ... Configure tx timeout ...
    (microsoft.public.windowsce.app.development)
  • Re: Socket recv() question?
    ... There's a limited amount of RAM in CE devices. ... Configure tx timeout ... increasing the timeout using the select method on the socket descriptor. ... sockets to send binary data from a pc to Pocket PC. ...
    (microsoft.public.windowsce.app.development)
  • Re: GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
    ... I only mentioned alternatives to implementing a timeout. ... Most socket i/o code does not bother with a timeout at all. ... Via a BeginXXX method you tell .NET to call a specific method when the i/o completes, and when it completes, your method is called. ...
    (microsoft.public.dotnet.framework)
  • Re: Socket recv() question?
    ... You might be doing something crazy, writing the data to the file one byte ... socket function correctly? ... The PC would send the data and Pocket PC would receive it. ... Configure tx timeout ...
    (microsoft.public.windowsce.app.development)

Loading