Compile error, help!
-
s = new Socket( AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp ); s.Bind(localEndPoint); s.SetSocketOption(SocketOptionLevel.Udp, SocketOptionName.ReceiveTimeout,1000); This code produces a runtime error: An unknown, invalid, or unsupported option or level was specified in a getsockop t or setsockopt call Any help anyone ? I just want to set a timeout on recive of a UDP packet.
-
s = new Socket( AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp ); s.Bind(localEndPoint); s.SetSocketOption(SocketOptionLevel.Udp, SocketOptionName.ReceiveTimeout,1000); This code produces a runtime error: An unknown, invalid, or unsupported option or level was specified in a getsockop t or setsockopt call Any help anyone ? I just want to set a timeout on recive of a UDP packet.
I believe it is because UDP doesn't support Timeouts, or so this thread on the Advanced DOTNET list seems to suggest. Yes just when you thought I couldn't push the DOTNET mailing list anymore they make a new one! :laugh: Hope that thread gives you some ideas, James Sonork ID: 100.11138 - Hasaki "My words but a whisper -- your deafness a SHOUT. I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
-
I believe it is because UDP doesn't support Timeouts, or so this thread on the Advanced DOTNET list seems to suggest. Yes just when you thought I couldn't push the DOTNET mailing list anymore they make a new one! :laugh: Hope that thread gives you some ideas, James Sonork ID: 100.11138 - Hasaki "My words but a whisper -- your deafness a SHOUT. I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
You are right, UDP is "connectionless", and because of that you can't set a timeout. When you send UDP packets, you just send them, but you never know if the reciever get the packets or not... - Anders Money talks, but all mine ever says is "Goodbye!"
-
I believe it is because UDP doesn't support Timeouts, or so this thread on the Advanced DOTNET list seems to suggest. Yes just when you thought I couldn't push the DOTNET mailing list anymore they make a new one! :laugh: Hope that thread gives you some ideas, James Sonork ID: 100.11138 - Hasaki "My words but a whisper -- your deafness a SHOUT. I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
Thanks, James, for the link to those two DotNet mailing lists. I'm already signed up! :-D -- Peter Stephens