CSocket::CancelBlockingCall() from another thread?
-
I use a CSocket derived class with a derived CWinThread class and use CArchive with it. For some yet unknown reason Send() locks after a while of running (hours). The opened socket has communication initiated from both client and server at times, if that helps. (Server sends tiny data once per second, client sends kB data occasionally, like every 10 seconds or so, plus both sides sends an ACK byte for every command) Anyway, since I cannot find the reason of the locking, I want to get around the locked state. I want to make something from the outside and would like to have an OnIdle timer reset at intervals in the CWinThread. A parent thread will check this timer and if it isn't reset in reasonable time (seconds) the parent thread will call CancelBlockingCall() on the locked socket. Now, will this work? Isn't it illegal to call the CSocket object function from another thread?
-
I use a CSocket derived class with a derived CWinThread class and use CArchive with it. For some yet unknown reason Send() locks after a while of running (hours). The opened socket has communication initiated from both client and server at times, if that helps. (Server sends tiny data once per second, client sends kB data occasionally, like every 10 seconds or so, plus both sides sends an ACK byte for every command) Anyway, since I cannot find the reason of the locking, I want to get around the locked state. I want to make something from the outside and would like to have an OnIdle timer reset at intervals in the CWinThread. A parent thread will check this timer and if it isn't reset in reasonable time (seconds) the parent thread will call CancelBlockingCall() on the locked socket. Now, will this work? Isn't it illegal to call the CSocket object function from another thread?
Read the message at the top of this page. X| Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018 "Don't belong. Never join. Think for yourself. Peace" - Victor Stone
-
Read the message at the top of this page. X| Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018 "Don't belong. Never join. Think for yourself. Peace" - Victor Stone
and to spell it out for you: Programming questions? Try the Forums: Visual C++ .NET C# COM SQL / ADO / ADO.NET Visual Basic Web Design General Discussions Code Requests Java Operating Systems Collaboration / Testing SysAdmin Suggestions Rant and Rave (Unmoderated) Ok :eek: Norm Almond Chief Technical Architect FS Walker Hughes Limited
-
Read the message at the top of this page. X| Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018 "Don't belong. Never join. Think for yourself. Peace" - Victor Stone
Crap, I saw the drop box display "Visual C++" and thought I was in the right area... thanks.
-
Crap, I saw the drop box display "Visual C++" and thought I was in the right area... thanks.
No worries. Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018 "Don't belong. Never join. Think for yourself. Peace" - Victor Stone