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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CSocket Help

CSocket Help

Scheduled Pinned Locked Moved C / C++ / MFC
help
2 Posts 2 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.
  • A Offline
    A Offline
    aarong
    wrote on last edited by
    #1

    I am currently having problems with the CSocket Class. My main problem is that when I call the Accept(), function my program will crash. I believe I am using all the correct parameters. Even in sample programs that I have downloaded it does the same thing, I was wondering if perhaps it had to do with me using Win2k. Any help will be Greatly Appreciated. -Aaron

    R 1 Reply Last reply
    0
    • A aarong

      I am currently having problems with the CSocket Class. My main problem is that when I call the Accept(), function my program will crash. I believe I am using all the correct parameters. Even in sample programs that I have downloaded it does the same thing, I was wondering if perhaps it had to do with me using Win2k. Any help will be Greatly Appreciated. -Aaron

      R Offline
      R Offline
      RobJones
      wrote on last edited by
      #2

      Here is a sample of code I'm using and it works fine.. I am all so running windows 2k pro.. so I doubt that the OS is the problem.. If this doesnt help, I could email you the whole project I made and you can try to run it on your pc to rule out OS or what not.. void CChatDlg::OnAccept() { if(m_bConnected) { //create a rejection socket CAsyncSocket sRjctSock; //Acept using the rejection socket m_sListenSocket.Accept(sRjctSock); //Close the socket sRjctSock.Close(); } else { //Accept the connection request m_sListenSocket.Accept(m_sConnectSocket); //Mark the socket as connected m_bConnected = TRUE; UpdateData(FALSE); } } Hope this helps.. Rob Jones

      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