Re: Socket timeout



Chris,

Thanks for the link. So, it seems that (for whatever reason), we cannot set
a timeout on a socket. I'm going to create a thread as Paul suggested and
hopefully that achieves the same thing.

Thanks again, you guys are great!

Hilton
P.S.: I can't help but chuckle when I hear people from other software
companies say: "We have it working on the desktop so we'll just port it to
the Pocket PC." :) Just to clarify, I love the Pocket PC, CF, and C#, but
writing for the PPC isn't anything like writing for the desktop.


"<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
news:ebxMYrvwGHA.4256@xxxxxxxxxxxxxxxxxxxxxxx
As an explanation for what you see:

http://blogs.msdn.com/davidklinems/archive/2004/06/25/166208.aspx

-Chris

"Hilton" <nospam@xxxxxxxxxx> wrote in message
news:neoFg.14393$gY6.2246@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Paul wrote:
I'm not sure what you mean by the question. You can't set socket
time-outs on a per-socket basis, no. You can build your own time-out
mechanism by waiting while the socket does some operation that you might
want to time-out in another thread and, when you decide that the
time-out has occurred, close the socket out from under whatever other
call is executing.

Maybe a better description of what you're trying to achieve and why...

Paul,

Well, this call to set a timeout on a socket throws an exception (hence
my question):
socket.SetSocketOption (SocketOptionLevel.Socket,
SocketOptionName.SendTimeout, timeout);

I will definitely try your suggestion. Thank you again,

Hilton








.



Relevant Pages

  • Re: Socket recv() question?
    ... You might be doing something crazy, writing the data to the file one byte at ... socket function correctly? ... How come when I use the IE on the Pocket PC and started IIS on my PC. ... Configure tx timeout ...
    (microsoft.public.windowsce.app.development)
  • Re: GetStream.Read behavior changed in .Net 2.0 with respect to ReceiveTimeout
    ... I only mentioned alternatives to implementing a timeout. ... Most socket i/o code does not bother with a timeout at all. ... Via a BeginXXX method you tell .NET to call a specific method when the i/o completes, and when it completes, your method is called. ...
    (microsoft.public.dotnet.framework)
  • Re: Socket recv() question?
    ... You might be doing something crazy, writing the data to the file one byte ... socket function correctly? ... The PC would send the data and Pocket PC would receive it. ... Configure tx timeout ...
    (microsoft.public.windowsce.app.development)
  • Re: Threads and socket.setdefaulttimeout
    ... settimeout on the socket) was because it seemed like the only way (and ... > their timeout period to allow other runnable threads to proceed. ... making the since-bad choice of using setdefaulttimeout to get timeouts ... code needs to check the lock to avoid conflict. ...
    (comp.lang.python)
  • Re: Socket recv() question?
    ... You might be doing something crazy, writing the data to the file one byte at ... socket function correctly? ... How come when I use the IE on the Pocket PC and started IIS on my PC. ... Configure tx timeout ...
    (microsoft.public.windowsce.app.development)