Socket problem here
-
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
-
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
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 ) ;