socket_res = socket(AF_INET, SOCK_STREAM, 0); if(socket_res < 0){ printf("Can't create socket\n"); return -1; } server.sin_family = AF_INET; server.sin_addr.s_addr = inet_addr("127.0.0.1"); //localhost server.sin_port = htons(42742); //port sur lequel tourne server