Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Socket.Select() not working at win ce 6 r3

4 views
Skip to first unread message

Igor Golikov

unread,
Nov 10, 2009, 2:59:54 AM11/10/09
to
Hi
I am trying to use Socket.Select() in my .net app on windows ce 6.
Sometimes it works and sometimes it throws NotSupported Exception ()
with following stack trace:

at System.Array.System.Collections.IList.RemoveAt(Int32 index)
at System.Net.Sockets.Socket.selectFD(IList SL, Int32[] fdarray)
at System.Net.Sockets.Socket.Select(IList checkRead, IList
checkWrite, IList checkError, Int32 microSeconds)

My checkRead list has 15 sockets, and checkWrite and checkError are
nulls.
I pass 1000 as a timeout and then I sleep my thread for 10ms before
another try...
If I watch in the debuger some sockets have available data (Availble =
xxx) but still exception is thrown.

Since this is NotSupported exception I may suppose that some operation
is not supported on win ce / .net compact?

Thanks

Paul G. Tobey [eMVP]

unread,
Nov 11, 2009, 12:05:41 AM11/11/09
to
There are two things that come to mind: the framework itself is trying to do
something to an object that shouldn't have that operation performed on it,
or you are performing an operation on an object that shouldn't have that
operation performed on it. Obviously, trying to identify what object is
being done to and what's being done to it is the basis of figuring out what
to do about it, so you need to examine all of the exception information that
you get when it's thrown. It would be worth checking whether there are any
cases where you attempt a Select() on a socket that is a) closed, b)
uninitialized, c) in some intermediate state where Select has no defined
behavior (like calling it on a socket before you bind it, try to connect it
to a server, etc.)

Paul T.

"Igor Golikov" <sali...@gmail.com> wrote in message
news:81daa08f-4797-41e7...@a31g2000yqn.googlegroups.com...

Igor Golikov

unread,
Nov 11, 2009, 1:24:53 AM11/11/09
to
On Nov 11, 7:05 am, "Paul G. Tobey [eMVP]" <paul tobey _AT_ earthlink

_DOT_ net> wrote:
> There are two things that come to mind: the framework itself is trying to do
> something to an object that shouldn't have that operation performed on it,
> or you are performing an operation on an object that shouldn't have that
> operation performed on it.  Obviously, trying to identify what object is
> being done to and what's being done to it is the basis of figuring  out what
> to do about it, so you need to examine all of the exception information that
> you get when it's thrown.  It would be worth checking whether there are any
> cases where you attempt a Select() on a socket that is a) closed, b)
> uninitialized, c) in some intermediate state where Select has no defined
> behavior (like calling it on a socket before you bind it, try to connect it
> to a server, etc.)
>
> Paul T.
>
> "Igor Golikov" <salier...@gmail.com> wrote in message

>
> news:81daa08f-4797-41e7...@a31g2000yqn.googlegroups.com...
>
>
>
> > Hi
> > I am trying to use Socket.Select() in my .net app on windows ce 6.
> > Sometimes it works and sometimes it throws NotSupported Exception ()
> > with following stack trace:
>
> >   at System.Array.System.Collections.IList.RemoveAt(Int32 index)
> >   at System.Net.Sockets.Socket.selectFD(IList SL, Int32[] fdarray)
> >   at System.Net.Sockets.Socket.Select(IList checkRead, IList
> > checkWrite, IList checkError, Int32 microSeconds)
>
> > My checkRead list has 15 sockets, and checkWrite and checkError are
> > nulls.
> > I pass 1000 as a timeout and then I sleep my thread for 10ms before
> > another try...
> > If I watch in the debuger some sockets have available data (Availble =
> > xxx) but still exception is thrown.
>
> > Since this is NotSupported exception I may suppose that some operation
> > is not supported on win ce / .net compact?
>
> > Thanks- Hide quoted text -
>
> - Show quoted text -

Hi Paul
Thank you for your answer

Well I have done the same with Poll() and it works.
I just iterate through the list of same sockets Select() has failed on
and polling each of them for being readable. If the answer is yes, I
perform the receive operation on that socket.
It works for me.
I am sure that all the sockets are opened and connected.
I have tryed to look at the Select method in Reflektor but... to my
great surprise the function body is empty like in all Socket class
methods...

0 new messages