I’ve created this simple example program, but this doesn’t work. it won’t connect. any idea why?
#include <stdio.h>
#include <afxsock.h>
void main()
{
int lalala;
CSocket mySocket;
printf("%d\n", mySocket.Create());
CString ipAddress = _T("127.0.0.1");
lalala = mySocket.Connect(ipAddress, 3015);
printf("%d", lalala);
getchar();
}
i already have a program that listens to port 3015
Have you initialized the socket using AfxSocketInit()? If not call it before you create the socket