Hi!

I am having following code:

System.Net.Sockets.Socket mySocket;
....
mySocket.Receive(aBuffer, aOffset, aSize, SocketFlags.Peek)


When running on PocketPC device (Windows Mobile 2003, 4.20) , or in Emulator
(PPC 2003 SDK), I am getting exception:
An unhandled exception of type 'System.Net.Sockets.SocketException' occurred
in System.dll

Additional information: The attempted operation is not supported for the
type of object reference


.......

Code is running fine on PC (full framework)
It also works on PPC only when I use SocketFlags.None

Documentation says that Peek flag is supported on CF

?

Re: Is Socket.Receive(..., SocketFlags.Peek) supported in .NET CF ? by OM

OM
Sat Apr 30 19:57:52 CDT 2005

Not sure why you're getting an exception, however peek is not supported on
windows CE.
Here's the msdn doc:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcesdkr/html/wcesdkrrecvfrom.asp

and a snippet:
Windows CE does not support the MSG_OOB value for processing out-of-band
data, and does not support the MSG_PEEK value for copying data into the
buffer without removing the date from the input queue.

This posting is provided "AS IS" with no warranties, and confers no rights.


"no" <no@no.no> wrote in message
news:O7dm29LTFHA.2676@TK2MSFTNGP10.phx.gbl...
> Hi!
>
> I am having following code:
>
> System.Net.Sockets.Socket mySocket;
> ....
> mySocket.Receive(aBuffer, aOffset, aSize, SocketFlags.Peek)
>
>
> When running on PocketPC device (Windows Mobile 2003, 4.20) , or in
> Emulator (PPC 2003 SDK), I am getting exception:
> An unhandled exception of type 'System.Net.Sockets.SocketException'
> occurred in System.dll
>
> Additional information: The attempted operation is not supported for the
> type of object reference
>
>
> .......
>
> Code is running fine on PC (full framework)
> It also works on PPC only when I use SocketFlags.None
>
> Documentation says that Peek flag is supported on CF
>
> ?
>
>