Thread: WSPCancelBlockingCall

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    10

    WSPCancelBlockingCall

    The documentation on this function says it cancels any blocking Winsock call in the current thread. How is it possible to call WSPCancelBlockingCall from the same thread if there is a blocking call in progress?

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    The documentation states how it gets called. Either as a callback or via a service message.

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    You do not call WSP* functions. These are functions that are implemented by socket providers. You call these functions. As stated by the documentation for WSACancelBlockingCall, it is obsolete and must not be used in modern applications. It dates back from Win16. Instead of creating a thread (pre-emptive threads were not available in Win16), Windows would call a callback in the current thread so that the GUI could be kept functional. This scheme is described on this page.

  4. #4
    Registered User
    Join Date
    Oct 2005
    Posts
    10
    Ok, then does anyone, have any suggestion on how to cancel a blocking call on a socket or thread?

    Thanks

  5. #5
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Call closesocket (I meant to mention this in my original post).

  6. #6
    Registered User
    Join Date
    Oct 2005
    Posts
    10
    Quote Originally Posted by anonytmouse
    Call closesocket (I meant to mention this in my original post).
    I can't do that. It is a socket that I have no control over and I can't just close it.

  7. #7
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    Stop using a broken API then.

  8. #8
    Registered User
    Join Date
    Oct 2005
    Posts
    10
    Broken API? O.o It isn't my socket...

  9. #9
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    I don't know what that means.

Popular pages Recent additions subscribe to a feed