Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clientInfo* addClient(int i, clientList* list, sockAddrIn clientAddr){
- clientList* newClient = malloc(sizeof(clientList));
- newClient->next = list;
- list = newClient;
- newClient->client.id = i;
- newClient->client.idPlayer = -1;
- newClient->client.firstCon = 1;
- inet_ntop(AF_INET, &(clientAddr.sin_addr), newClient->client.ip, DIM_IP);
- if (list == NULL)printf("list null\n");
- else printf("not null\n"); //esce fuori un not null come dovrebbe
- return &(newClient->client);
- }
- int examineFD(int listeningSocket, fd_set* readSet, fd_set* writeSet, fd_set* readSetTmp, fd_set* writeSetTmp, int* maxFD, clientList* list){
- clientInfo* client;
- [...]
- client = addClient(newClient, list, clientAddr); // newClient รจ il ritorno dell'accept
- if (list == NULL)printf("list null\n");
- else printf("not null\n"); // qua invece esce list null....
- [...]
- }
Add Comment
Please, Sign In to add comment