|
-
May 11th, 1999, 09:22 AM
#1
MFC sockets help
I am trying to open a socket with a server on a specified port. Right now all I want to do is create the socket and open the connection with the server. I am new to the sockets thing and could use some help. After creating a small dialog based application with winsock support I declare:
//declared public in the dialog class
CAsyncSocket m_thesocket;
//then I call its Create method on the action of a pushbutton
if(m_thesocket.Create())
{
AfxMessageBox("Socket successfully created!");
}
else
{
AfxMessageBox("Socket creation error!");
}
//now for the connection - using a unix pop server - is this ok?
if (m_thesocket.Connect("servename.com", 25))
{
AfxMessageBox("Connection successfull!");
}
else
{
AfxMessageBox("Connection error!");
}
Right now I just want to know that the connection is made. But for some reason it is not being made. Is it possible to open a connection with a pop server on port 25 in this manner? Any help would be greatly appreciated. Thanks in advance.
--------------------
Bruce Campbell
[email protected]
-----------------
Bruce Campbell
[email protected]
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
|