C Board  

Go Back   C Board > General Programming Boards > Networking/Device Communication

Reply
 
LinkBack Thread Tools Display Modes
Old 10-05-2005, 10:16 PM   #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?
RITZ is offline   Reply With Quote
Old 10-06-2005, 05:27 AM   #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.
orbitz is offline   Reply With Quote
Old 10-06-2005, 01:04 PM   #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.
anonytmouse is offline   Reply With Quote
Old 10-06-2005, 04:08 PM   #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
RITZ is offline   Reply With Quote
Old 10-06-2005, 06:01 PM   #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).
anonytmouse is offline   Reply With Quote
Old 10-06-2005, 11:24 PM   #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.
RITZ is offline   Reply With Quote
Old 10-07-2005, 11:38 AM   #7
Registered User
 
Join Date: Nov 2002
Posts: 491
Stop using a broken API then.
orbitz is offline   Reply With Quote
Old 10-13-2005, 06:26 AM   #8
Registered User
 
Join Date: Oct 2005
Posts: 10
Broken API? O.o It isn't my socket...
RITZ is offline   Reply With Quote
Old 10-13-2005, 01:55 PM   #9
Registered User
 
Join Date: Nov 2002
Posts: 491
I don't know what that means.
orbitz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump


All times are GMT -6. The time now is 09:22 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22