Click here to Skip to main content
15,880,796 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: How to get used dll's path information programetically? Pin
litu kumar7-Nov-12 22:35
litu kumar7-Nov-12 22:35 
GeneralRe: How to get used dll's path information programetically? Pin
Richard MacCutchan8-Nov-12 0:16
mveRichard MacCutchan8-Nov-12 0:16 
GeneralRe: How to get used dll's path information programetically? Pin
litu kumar8-Nov-12 2:58
litu kumar8-Nov-12 2:58 
GeneralRe: How to get used dll's path information programetically? Pin
Richard MacCutchan8-Nov-12 4:03
mveRichard MacCutchan8-Nov-12 4:03 
GeneralRe: How to get used dll's path information programetically? Pin
litu kumar15-Nov-12 19:53
litu kumar15-Nov-12 19:53 
GeneralRe: How to get used dll's path information programetically? Pin
Richard MacCutchan15-Nov-12 23:50
mveRichard MacCutchan15-Nov-12 23:50 
AnswerRe: How to get used dll's path information programetically? Pin
hacker240union22-Nov-12 23:41
hacker240union22-Nov-12 23:41 
Questiondetect close event with CAsyncSocket Pin
bkelly135-Nov-12 10:32
bkelly135-Nov-12 10:32 
Environment: Windows 7, Visual Studio 2008, C++ MFC

Question:
How does class AsyncSocket for the server side detect and notify the application when the client closes the connection?

Details:
I wrote the async article found here: Asynchronous TCP Part 1 as a learning tool. Now that I am using that knowledge in a working project I find that when the client closes the socket, I don’t see any results on the server side. I was expecting that OnClose() would be called, but that does not happen. On the client side, after closing, no data can be received until it is Initialized and connected again.
The problem is that in the real application, when the client closes and re-connects the interface protocol for the client requires that the server send some specific information. I am not seeing a way to detect that closure.

Edit: OnClose is declared public. That was an answer in another thread.
And again: I do not have the client code and have no control over the client side behavior.
and again: continued searching yielded something about the read() method getting a result or error. This server application never receives any data from the client and uses no reads. Do I still need to post a read to get a close status?

POSSIBLE ANSWER
My application uses C_Server, decended from CAsyncSocket, to post the Listen and call Accept(). In the call to Accept it creates an object from C_Server_Send to communicate with the client. When I add code to post a receive from C_Server_Send, and then close the client, OnClose() from C_Server_Send gets called. So, empirically, I conclude that Yes, I must post a receive to enable detection of client disconnect. Is that correct?

NEW PROBLEM:
How is C_Server_Send to be deleted.
First: C_Server_Send was newed from C_Server, but that object can create an indefiniate number of C_Server_Send objects as multiple clients connect. Must it keep track of each one.
Second: How does C_Server know that its time to delete an arbitrary instance of C_Server_Send?
Thanks for your time


modified 6-Nov-12 12:54pm.

QuestionIntermediate GUI Techniques Pin
bkelly132-Nov-12 3:21
bkelly132-Nov-12 3:21 
AnswerRe: Intermediate GUI Techniques Pin
Richard MacCutchan2-Nov-12 6:20
mveRichard MacCutchan2-Nov-12 6:20 
Questionproblem with sprintf_s() on win 7 Pin
Member 93537761-Nov-12 21:34
Member 93537761-Nov-12 21:34 
AnswerRe: problem with sprintf_s() on win 7 Pin
Richard MacCutchan1-Nov-12 22:50
mveRichard MacCutchan1-Nov-12 22:50 
GeneralRe: problem with sprintf_s() on win 7 Pin
bkelly132-Nov-12 3:16
bkelly132-Nov-12 3:16 
GeneralRe: problem with sprintf_s() on win 7 Pin
Richard MacCutchan2-Nov-12 6:15
mveRichard MacCutchan2-Nov-12 6:15 
GeneralRe: problem with sprintf_s() on win 7 Pin
Member 93537764-Nov-12 16:34
Member 93537764-Nov-12 16:34 
GeneralRe: problem with sprintf_s() on win 7 Pin
Richard MacCutchan4-Nov-12 21:26
mveRichard MacCutchan4-Nov-12 21:26 
AnswerRe: problem with sprintf_s() on win 7 Pin
H.Brydon26-Nov-12 19:36
professionalH.Brydon26-Nov-12 19:36 
Questionwsageterror() Pin
bkelly131-Nov-12 15:28
bkelly131-Nov-12 15:28 
AnswerRe: wsageterror() Pin
Richard MacCutchan1-Nov-12 22:48
mveRichard MacCutchan1-Nov-12 22:48 
QuestionSTL map issue in VS2010 Pin
Subhash Madhukar30-Oct-12 3:47
Subhash Madhukar30-Oct-12 3:47 
AnswerRe: STL map issue in VS2010 Pin
Richard MacCutchan30-Oct-12 6:04
mveRichard MacCutchan30-Oct-12 6:04 
Questionhow do i copy a CImage DIB to clipboard Pin
Member 951640015-Oct-12 11:15
Member 951640015-Oct-12 11:15 
AnswerRe: how do i copy a CImage DIB to clipboard Pin
chaau15-Oct-12 11:41
chaau15-Oct-12 11:41 
QuestionWhy does this fail - CFile / SeekToEnd? Pin
charlieg10-Oct-12 6:43
charlieg10-Oct-12 6:43 
AnswerRe: Why does this fail - CFile / SeekToEnd? Pin
charlieg10-Oct-12 9:31
charlieg10-Oct-12 9:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.