crasing in CAsyncSocket Accept
-
hi friends, class MyEchoSocket : public CAsyncSocket { public: virtual void OnAccept(int nErrorCode); virtual void OnClose(int nErrorCode); virtual void OnConnect(int nErrorCode); virtual void OnOutOfBandData(int nErrorCode); virtual void OnReceive(int nErrorCode); virtual void OnSend(int nErrorCode); }; class CServerDlg : : public CDialog { public: void OnReceive(); void OnClose(); void OnAccept(); void OnSent(); CSolusServerDlg(CWnd* pParent = NULL); // standard constructor }; void CServerDlg::OnAccept() { CString strIP; UINT port; if(m_sListener.Accept(m_sConnected)) { m_sConnected.GetPeerName(strIP,port); m_status = strIP ; UpdateData(FALSE); } else { AfxMessageBox("Cannot Accept Connection"); } } this above code is crasing 2nd client accepting or multiple client trying to connect please help me...
-
hi friends, class MyEchoSocket : public CAsyncSocket { public: virtual void OnAccept(int nErrorCode); virtual void OnClose(int nErrorCode); virtual void OnConnect(int nErrorCode); virtual void OnOutOfBandData(int nErrorCode); virtual void OnReceive(int nErrorCode); virtual void OnSend(int nErrorCode); }; class CServerDlg : : public CDialog { public: void OnReceive(); void OnClose(); void OnAccept(); void OnSent(); CSolusServerDlg(CWnd* pParent = NULL); // standard constructor }; void CServerDlg::OnAccept() { CString strIP; UINT port; if(m_sListener.Accept(m_sConnected)) { m_sConnected.GetPeerName(strIP,port); m_status = strIP ; UpdateData(FALSE); } else { AfxMessageBox("Cannot Accept Connection"); } } this above code is crasing 2nd client accepting or multiple client trying to connect please help me...
Member 3653751 wrote:
this above code is crasing...
Which is fairly meaningless given that you've provided no context, or stated exactly what is happening. By "crash" do you mean an exception is thrown, an assertion is fired, or something else? Please elaborate. Have you used the debugger to narrow the problem down?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Member 3653751 wrote:
this above code is crasing...
Which is fairly meaningless given that you've provided no context, or stated exactly what is happening. By "crash" do you mean an exception is thrown, an assertion is fired, or something else? Please elaborate. Have you used the debugger to narrow the problem down?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
Debug asseration Failed... Program:c:\bujji\server\Debug\server.exe file : sockcoare.cpp line: 177 for more information on how your program can cause an asseration failure, see the vusial c++ Documentation on asserts. please help
-
Debug asseration Failed... Program:c:\bujji\server\Debug\server.exe file : sockcoare.cpp line: 177 for more information on how your program can cause an asseration failure, see the vusial c++ Documentation on asserts. please help
Member 3653751 wrote:
file : sockcoare.cpp line: 177
Locate the source file, and take a look at line 177 to see which condition is failing. That should get you started.
“Follow your bliss.” – Joseph Campbell