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. Socket problem here

Socket problem here

Scheduled Pinned Locked Moved C / C++ / MFC
helpsysadmin
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.
  • C Offline
    C Offline
    Cyberizen
    wrote on last edited by
    #1

    Hello ppl following is the code snippet if(!AfxSocketInit()) AfxMessageBox("Socket Init Error"); if(mysocket.Create(6000,SOCK_STREAM) == TRUE) AfxMessageBox("Socket Created"); if(server.Create(3000,SOCK_STREAM) == TRUE) AfxMessageBox("Server Socket Created"); if(server.Connect("172.16.65.122",6000) == TRUE) AfxMessageBox("Connected to client"); else { int a = server.GetLastError(); AfxMessageBox((CString)a); } what i am trying to do here is that i need to connect to the same machine using socks for that reason i have created two sockets one that actually should act as a client and other as a server now both the sockets are created successfully but server is unable to connect to the client (remember client is the same machine as server) the error no that is returned is 3 and i dont know what it means please help me out i am a socket newbie thanks

    J 1 Reply Last reply
    0
    • C Cyberizen

      Hello ppl following is the code snippet if(!AfxSocketInit()) AfxMessageBox("Socket Init Error"); if(mysocket.Create(6000,SOCK_STREAM) == TRUE) AfxMessageBox("Socket Created"); if(server.Create(3000,SOCK_STREAM) == TRUE) AfxMessageBox("Server Socket Created"); if(server.Connect("172.16.65.122",6000) == TRUE) AfxMessageBox("Connected to client"); else { int a = server.GetLastError(); AfxMessageBox((CString)a); } what i am trying to do here is that i need to connect to the same machine using socks for that reason i have created two sockets one that actually should act as a client and other as a server now both the sockets are created successfully but server is unable to connect to the client (remember client is the same machine as server) the error no that is returned is 3 and i dont know what it means please help me out i am a socket newbie thanks

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      if i read well ur server is connecting to a client??? this is odd :) try that the client connects to the server the server must be listening to its socket (look at Listen and Bind) i recomand you to look for NDK on CP anyway the error code 3 means "The system cannot find the path specified. ERROR_PATH_NOT_FOUND" Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      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