Re: WinCE socket select/recv fails when peer sends less than 4 byt

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.
>>
>


.



Relevant Pages

  • Re: WinCE socket select/recv fails when peer sends less than 4 byt
    ... Unfortunately, send is defined in Perl like this: ... but uses the third parameter for the FLAGS. ... sent as OOB data while the WinCE client was just waiting for normal data. ...
    (microsoft.public.dotnet.framework.compactframework)
  • about building release 6.0
    ... Build a threading Perl? ... Checking for optional libraries... ... Let me guess what the preprocessor flags are... ... Checking your choice of C compiler and flags for coherency... ...
    (freebsd-questions)
  • Re: why the perl docs suck
    ... It stands to reason that perl ... > allocation-copy-free sitting on top of block memory fragmented ... FLAGS = ... The fact that an upgrade results in a fresh allocation instead of an ...
    (comp.lang.perl.misc)
  • Re: Perl Performance Tuning
    ... o> This should be required reading for all Perl hackers, ... who in their right mind uses lots of bit flags for booleans in perl? ... use undef instead of 0 makes no sense. ... fix bugs when they were used outside their very tiny design envelope. ...
    (comp.lang.perl.misc)
  • Re: Learning Perl - the Good and the Bad (Tutorials, Habits, and Tools, etc)
    ... We can't give you all of Perl in just a few hours. ... Of course no book ever covers a major language completely. ... therefore requires, from simple honesty, a different level of warning - ... Paul) UNUSUAL - UNIQUE AND DANGEROUS - LEVEL OF ITS ...
    (perl.beginners)