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

set socket timeout problem

219 views
Skip to first unread message

Vladimir Zinin

unread,
Jan 31, 2003, 8:00:54 AM1/31/03
to
Hello All!

I has created the .NET Compact Framework
project (Windows CE Console Application)
and wrote this code

Socket socket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
try
{
socket.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReceiveTimeout, -1);
}
catch(SocketException e)
{
...........
}

and exception occured - "An unknown, invalid, or unsupported option
or level was specified in a getsockopt or setsockopt call"

Where is the problem???


Nicholas Paldino [.NET/C# MVP]

unread,
Jan 31, 2003, 8:43:13 AM1/31/03
to
Vladimir,

It could very well be the -1, is it a valid value for a timeout? I
think that you are trying to set it to infinite, but it might not like that.
Does it work with any other value? Perhaps sockets on CE don't support an
infinite timeout.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- nicholas...@exisconsulting.com

"Vladimir Zinin" <zi...@eldos.org> wrote in message
news:b1dktu$pfp$1...@news.dg.net.ua...

Vladimir Zinin

unread,
Jan 31, 2003, 11:32:50 AM1/31/03
to
Nicholas Paldino wrote:

>Vladimir,

> It could very well be the -1, is it a valid value for a timeout? I
>think that you are trying to set it to infinite, but it might not like
that.
>Does it work with any other value? Perhaps sockets on CE don't support an
>infinite timeout.

> Hope this helps.


No. When value for example = 100

socket.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReceiveTimeout, ***100***);

than exception throws too :-(.

Vladimir.


Vladimir Zinin

unread,
Jan 31, 2003, 11:38:07 AM1/31/03
to
When I wrote this code:
int t = (int)socket.GetSocketOption( SocketOptionLevel.Socket,

SocketOptionName.SendTimeout);

than result is (-1).

Vladimir.

Nicholas Paldino [.NET/C# MVP]

unread,
Jan 31, 2003, 9:32:24 AM1/31/03
to
Vladimir,

If this is the case, then it might be that this option is not supported
by the compact framework.


--
- Nicholas Paldino [.NET/C# MVP]
- nicholas...@exisconsulting.com

"Vladimir Zinin" <zi...@eldos.org> wrote in message

news:b1e1bb$1dfa$1...@news.dg.net.ua...

Vladimir Zinin

unread,
Jan 31, 2003, 12:06:36 PM1/31/03
to

"Nicholas Paldino wrote:

> Vladimir,
>
> If this is the case, then it might be that this option is not
supported
> by the compact framework.
>

But MSDN sad that ReceiveTimeout option
supported by the .NET Compact framework

Vladimir.


0 new messages