setting a socket receive buffer size not supported on ppc2k2?

S

Stephan Steiner

Hi

I use the following line in my code to increase the socket buffer size to
ensure that packets sent from a server won't be dropped because the buffer
fills up and the application isn't emptying the receive buffer fast enough.

sock.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReceiveBuffer, 65536);

This code works just fine on WM2k3, however I have recently downgraded to
PPC2k2 and now my program always fails with a
System.Net.Sockets.SocketException (An unknown, invalid, or unsupported
option or level was specified in a getsockopt or setsockopt call) error as
soon as this line is executed. If I comment it out, everything is fine but I
start loosing packets which is unacceptable. To verify that this line is
indeed the cause I've also executed my program on both PPC2k2 and WM2k3 and
a WM2k3 device we have here at work, and the picture is clear: It fails on
the PPC2k2 emulator and the PPC2k2 device, and works just fine on WM2k3
device and WM2k3 emulator.

I guess my question is why are there options in the .NET CF (which was
created prior to the release of WM2k3) that fail on PPC2k2 but work on the
latest OS? And is there any other way to increase (and decrease.. ) socket
buffer sizes on PPC2k2?

Stephan
 
A

Alex Feinman [MVP]

SO_RCVBUF option is indeed unsupported on CE 3.0 and fully supported on
CE.NET 4.1 and up. Since CF code is platform-agnostic, there is no error
thrown in compile time, but you get one in run time. This is the expected
behavior.

Stephan Steiner said:
sock.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReceiveBuffer, 65536);

This code works just fine on WM2k3, however I have recently downgraded to
PPC2k2 and now my program always fails with a

HTH

Alex Feinman
 
S

Stephan Steiner

I figured that much, but somehow I was expecting to be told about it in some
documentation. This isn't the first time that I suddenly run into an
unanticipated wall because certain things are just not properly documented
even though the people at Microsoft are fully aware of the problems that can
(and will) arise. A note in the API documentation hinting that this feature
is not supported on CE below 4.1 would make people think twice before using
the command.

Is there a possibility to change receive buffer sizes on CE 3.0?

Stephan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top