Exception setting SocketOption

  • Thread starter Thread starter Milosz - [playseven.com]
  • Start date Start date
M

Milosz - [playseven.com]

Dim EP As System.Net.IPEndPoint = New System.Net.IPEndPoint(mIP, mPort)


Dim S As Socket = New Socket(EP.AddressFamily, SocketType.Dgram,
ProtocolType.Udp)

S.SetSocketOption(Sockets.SocketOptionLevel.Socket,
Sockets.SocketOptionName.SendTimeout, Me.mTimeOUT)

.......

it crashes with Exception:

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

it seems it does not matter what value is me.mTimeout. i tried 100 and 1000.
I tried also ReceiveTimeOut and with a TCP Socket but it always crashes.

the method is running in an own thread

Somebody knows help ?

THX Milosz



--
-> Milosz Weckowski
www.playseven.com

mailto:[email protected]
ICQ Number: 84867613

Get the enhanced Progressbar and a fine Colorpicker for the Compact Framwork
for free:
http://www.playseven.com/11620/p7_Controls.html
 
thx alex and sorry for the crosspost, no answer was coming in the other
thread..

Does anybody knows a workaround for the timeout problem ?

regards Milosz
 
The stock answer is to use asynchronous calls and implement the timeout
yourself using one-shot timers (system.Threading.Timer)
 
Back
Top