Guest User

Untitled

a guest
Aug 10th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. clientInfo* addClient(int i, clientList* list, sockAddrIn clientAddr){
  2. clientList* newClient = malloc(sizeof(clientList));
  3.  
  4. newClient->next = list;
  5. list = newClient;
  6.  
  7. newClient->client.id = i;
  8. newClient->client.idPlayer = -1;
  9. newClient->client.firstCon = 1;
  10. inet_ntop(AF_INET, &(clientAddr.sin_addr), newClient->client.ip, DIM_IP);
  11.  
  12. if (list == NULL)printf("list null\n");
  13. else printf("not null\n"); //esce fuori un not null come dovrebbe
  14. return &(newClient->client);
  15. }
  16.  
  17.  
  18. int examineFD(int listeningSocket, fd_set* readSet, fd_set* writeSet, fd_set* readSetTmp, fd_set* writeSetTmp, int* maxFD, clientList* list){
  19. clientInfo* client;
  20. [...]
  21. client = addClient(newClient, list, clientAddr); // newClient รจ il ritorno dell'accept
  22. if (list == NULL)printf("list null\n");
  23. else printf("not null\n"); // qua invece esce list null....
  24. [...]
  25. }
Add Comment
Please, Sign In to add comment