Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. crasing in CAsyncSocket Accept

crasing in CAsyncSocket Accept

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 3650979
    wrote on last edited by
    #1

    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...

    D 1 Reply Last reply
    0
    • U User 3650979

      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...

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      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

      U 1 Reply Last reply
      0
      • D David Crow

        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

        U Offline
        U Offline
        User 3650979
        wrote on last edited by
        #3

        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

        R 1 Reply Last reply
        0
        • U User 3650979

          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

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups