Re: WinCE socket select/recv fails when peer sends less than 4 byt
- From: "Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
- Date: Tue, 19 Jul 2005 17:15:49 -0700
Wow! Now *that's* an obscure problem!
Paul T.
"emzi" <emzi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2BDE355F-5324-4E18-BC10-3614ADCF5E37@xxxxxxxxxxxxxxxx
>I finally found the problem (shame on me:). The server side is written in
> Perl and
> has the statement send($sock,$buffer,length($buffer),0); for sending the
> data to the client. This reads o.k. when you look at the C BSD send
> interface.
> Unfortunately, send is defined in Perl like this: send
> SOCKET,MSG,FLAGS,TO
> So perl is not interested in the size of the buffer as it can retreive
> this
> with
> the length() function, but uses the third parameter for the FLAGS. What
> happend
> was simply that I have set some funny flags for the send call depending on
> the length of the buffer. This resulted in the MSG_OOB flag being set,
> which
> can
> be seen as TCP/URGENT flag on the ethereal traces. So all the small data
> was
> sent as OOB data while the WinCE client was just waiting for normal data.
> After fixing this, everything works of course fine also with small chunks
> of
> data...
>
> There is also an interesting page regarding OOB implementation
> incompatibilities
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/protocol_independent_out_of_band_data_2.asp
>
> Thanks a lot for your support !
>
> Michael
>
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> Nothing jumps out at me, but I've just written a simple socket receive
>> program and it works fine with Hyperterminal on the other end, where it's
>> hard to get it to send *more* than 4 bytes per packet. You might try
>> synchronous mode, rather than asynchronous. That should get you out of
>> using select(), although I've never had any problems with that call.
>>
>> Paul T.
>>
>
.
- References:
- WinCE socket select/recv fails when peer sends less than 4 bytes ?
- From: emzi
- Re: WinCE socket select/recv fails when peer sends less than 4 bytes ?
- From: Paul G. Tobey [eMVP]
- Re: WinCE socket select/recv fails when peer sends less than 4 byt
- From: emzi
- Re: WinCE socket select/recv fails when peer sends less than 4 byt
- From: emzi
- Re: WinCE socket select/recv fails when peer sends less than 4 byt
- From: Paul G. Tobey [eMVP]
- Re: WinCE socket select/recv fails when peer sends less than 4 byt
- From: emzi
- WinCE socket select/recv fails when peer sends less than 4 bytes ?
- Prev by Date: Re: Emulator + wifi
- Next by Date: SaveAs Dialog - default to storage card.
- Previous by thread: Re: WinCE socket select/recv fails when peer sends less than 4 byt
- Next by thread: pass complex structure to native function
- Index(es):
Relevant Pages
|