   datagram sockets not recieving packets (winsock)
  I'm working on a multiplayer game, using code developed from beej's guide for the net code. It used to work fine, and now after coming back to it after a couple of months holiday, the game doesn't detect the packets reaching the computer, I can't remember making any changes to the relevant bits of code.I think I've narrowed the problem down to something wrong with either the initialization of my socket, or with my call to select. The socket is initialized without errors. Debugging has found that select is timing out and returning 0, even after waiting for .8s, before select is called the sockets fd is definately in the fd_set. I've used wireshark to ensure that the packets are reaching my computer, and that they're destined for the port which the socket is connected to.Heres the code initializing the socket:memset(&hints, 0, sizeof hints);hints.ai_family = AF_UNSPEC; // set to AF_INET to force IPv4hints.ai_socktype = SOCK_DGRAM;hints.ai_flags = AI_PASSIVE; // use my IPif ((rv = getaddrinfo(NULL, SERVERPORT, &hints, &servinfo)) != 0) {fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));}// loop through all the results and bind to the first we canfor(p = servinfo; p != NULL; p = p->ai_next) {if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) {perror("listener: socket");continue;}if (bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) {closesocket(sockfd);perror("listener: bind");continue;}break;}if (p == NULL) {fprintf(stderr, "listener: failed to bind socket\n");}}and heres the code which should recieve the packages:FD_ZERO(&readfds);FD_SET(sockfd, &readfds);int testint;testint = select(sockfd + 1, &readfds, NULL, NULL, &tv;printf("listener: waiting to recvfrom %s, testint = %i\n", SERVERPORT, testint);if(FD_ISSET(sockfd, &readfds)){addr_len = sizeof their_addr;if ((numbytes = recvfrom(sockfd, buf, MAXBUFLEN-1 , 0, (struct sockaddr *)&their_addr, (int *)&addr_len)) == -1) {perror("recvfrom");exit(1);}Thanks in advance   
  I'm still having the same problem, even after looking at it for a few hours more. Still fairly sure I havn't changed this code since it last worked. The packets which are being sent are a little larger now, but still fairly small (on the order of 100 bytes), could that possibly be it?   ;  Are you sure it's not binding to an IPv6 address? If you use AF_UNSPEC then you'll get IPv6 back as one of the possible addresses, but if you're connecting to an IPv4 address, you're not going to see anything. Possibly you'll want to bind to all of the addresses returned by getaddrinfo, rather than just the first one.   ;  Thanks, i forced it to ipv4 and its working fine now.   