Allora sto provando a scrivere ma ho alcune domande.
Io uso windows, quindi uso winsock2.h per le socket. La guida che sto seguendo pero' usa linux e usa sys/socket.h
alla creazione delle socket procede cosi':
#include <sys/socket.h>
int s;
s = socket (AF_INET, SOCK_STREAM, 0);
if ( s < 0 )
{
perror("socket() ");
exit(1);
}
con winsock come devo procedere?
sto facendo cosi':
SOCKET client;
client = socket (AF_INET, SOCK_STREAM, 0);
if (client == INVALID_SOCKET);
{
WSACleanup();
return FALSE;
}
va bene?