Re: how to retreive WHOLE buffer with recv()
From: Arkady Frenkel (arkadyf_at_hotmailxdotxcom)
Date: 12/03/04
- Next message: John Spaith [MS]: "Re: can i load my own dll's into services.exe, if how"
- Previous message: Arkady Frenkel: "Re: how can we share common object bet'n two different processes"
- In reply to: Paul G. Tobey [eMVP]: "Re: how to retreive WHOLE buffer with recv()"
- Next in thread: Gnum: "Re: how to retreive WHOLE buffer with recv()"
- Reply: Gnum: "Re: how to retreive WHOLE buffer with recv()"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 3 Dec 2004 18:50:35 +0200
MTU ( max transport unit ) size of ethernet ( probably used in the case )
is 1500 bytes so server send at least 5 packets and not single one which
constructed on CE size on receive
Arkady
"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
wrote in message news:O$NX3NI2EHA.3336@TK2MSFTNGP11.phx.gbl...
> That's probably the TCP/IP stack, *not* the Windows CE code that's doing
it.
> Capture the packets to verify. If it is split into several packets, you
> can't get it all at once necessarily no matter what you do. There will
> always be situations where it will arrive separated in time by enough to
> cause some to be returned in one recv call and some in another. So, the
> moral of the story is, write your code to handle the data coming in in
> pieces and you won't have to worry about it.
>
> Paul T.
>
> "George" <gpn2atpitt.edu> wrote in message
> news:%23qZUx6F2EHA.2196@TK2MSFTNGP14.phx.gbl...
> > Hey guys, I was wondering if it is possible to retreive a whole buffer
> > through a recv() call on a socket. I have a java server that sends out
> > like
> > 7200 bytes or so, and my recv() calls in c++ ALWAYS want to break it up
> > into
> > like 1000, then like 6200 or so.
> >
> > nRecv = recv(wcsock, tempData, 10000, 0);
> >
> > (tempData has a size of 10000)
> > Is there any way to get it to read all the data waiting to be read with
> > recv() all at once?
> >
> > I saw in the msdn that a MSG_PEEK flag will " subsequently returns the
> > amount of data that can be read in a single call to the recv()"
> >
> > But everytime I try to add the MSG_PEEK flag to my recv() call, it
> > returns -1.
> >
> > How can i receive the whole buffer at once?
> >
> >
>
>
- Next message: John Spaith [MS]: "Re: can i load my own dll's into services.exe, if how"
- Previous message: Arkady Frenkel: "Re: how can we share common object bet'n two different processes"
- In reply to: Paul G. Tobey [eMVP]: "Re: how to retreive WHOLE buffer with recv()"
- Next in thread: Gnum: "Re: how to retreive WHOLE buffer with recv()"
- Reply: Gnum: "Re: how to retreive WHOLE buffer with recv()"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|