-
May 29th, 2004, 11:41 PM
#1
Help needed on CSocket
I want to use CSocket. but when i called Create() function, it always return 0, i gave the following code fragment here.
what is the wrong? did i do any mistake? Help is needed. if you can provide me sample code i will be happy.
CSocket serverSocket, clientConnection;
if(!serverSocket.Create(4001)){
m_StaticText.SetWindowText("Server Create error...");
return;
}
if(!serverSocket.Listen()){
m_StaticText.SetWindowText("Server Listen error...");
return;
}
if(!serverSocket.Accept(clientConnection)){
m_StaticText.SetWindowText("Server Accept error...");
return;
}
-
May 30th, 2004, 01:12 AM
#2
Hi,
Have called AfxSocketInit() somewhere before you start using these objects??...Usually at Initinstance() of your application..
Hope that helps
Mustafa
______________________________
To err is human, it's the computer that causes blunders !!!
DO: Dazzle me with your intelligence
DON'T : Confuse me with your bullshit
-
May 30th, 2004, 01:31 AM
#3
thanks a lot, it's working now.
-
May 31st, 2004, 05:22 AM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|