Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 9, 2010, 1:09:09 AM (14 years ago)
Author:
adrfried
Message:

fix some stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ipv6/src/external/enet/unix.c

    r7377 r7389  
    120120    if (family == ENET_IPV4 &&
    121121      (enet_get_address_family (address) == ENET_IPV4 ||
    122       !memcmp (address, & ENET_HOST_ANY, sizeof(ENetHostAddress))))
     122      !memcmp (& address -> host, & ENET_HOST_ANY, sizeof(ENetHostAddress))))
    123123    {
    124124        ((struct sockaddr_in *) sin) -> sin_family = AF_INET;
     
    398398enet_socket_wait (ENetSocket socket4, ENetSocket socket6, enet_uint32 * condition, enet_uint32 timeout)
    399399{
    400     //FIXME allow only one of the sockets being available
    401400//#ifdef HAS_POLL
    402401    struct pollfd pollSocket[2];
    403402    int pollCount;
    404    
     403
    405404    pollSocket[0].fd = socket4;
    406405    pollSocket[1].fd = socket6;
    407406    pollSocket[0].events = 0;
    408407    pollSocket[1].events = 0;
     408    //pollSocket[0].revents = 0;
     409    pollSocket[1].revents = 0;
     410
     411    if (pollSocket[0].fd == ENET_SOCKET_NULL)
     412    {
     413        pollSocket[0].fd = pollSocket[1].fd;
     414        pollSocket[1].fd = ENET_SOCKET_NULL;
     415    }
    409416
    410417    if (* condition & ENET_SOCKET_WAIT_SEND)
     
    420427    }
    421428
    422     pollCount = poll (pollSocket, 2, timeout);
     429    pollCount = poll (pollSocket, pollSocket[1].fd != ENET_SOCKET_NULL ? 2 : 1, timeout);
    423430
    424431    if (pollCount < 0)
     
    438445    return 0;
    439446/*
    440 FIXME: implement this
     447FIXME: implement or remove this
    441448#else
    442449    fd_set readSet, writeSet;
Note: See TracChangeset for help on using the changeset viewer.