quote:
Original post by Tran Minh Quang
this is my code:
//Socket descriptor
SOCKET sock;
if ((sock = socket(PF_INET, SOCK_STREAM, 0)) == INVALIDE_SOCKET)
{
perror("connect() failed");
exit(0);
}
For starters try INVALID_SOCKET instead of INVALIDE_SOCKET
You might also want to change the perror call to
perror("socket() failed")
And also note that on Windows NT/Windows 2000, raw socket support requires administrative privileges.