Changeset b495a1


Ignore:
Timestamp:
10/07/08 10:08:08 (4 years ago)
Author:
Tomash Brechko <tomash.brechko@…>
Branches:
master
Children:
65a14e
Parents:
f0c0ca
git-author:
Tomash Brechko <tomash.brechko@…> (10/07/08 10:08:08)
git-committer:
Tomash Brechko <tomash.brechko@…> (10/07/08 10:08:08)
Message:

Move can_poll_fd() to header, and make it no-op on Win32.

See added comment describing FD_SETSIZE on Win32.

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • Changes

    r255201 rb495a1  
    1010        Add support for Win32.  I personally don't have the system nor 
    1111        compiler, so I can't even test the build.  Win32 port is 
    12         expected to be supported by community. 
     12        expected to be supported by community.  Note: on Win32 below 
     13        Windows Vista max number of memcached servers is 64.  See 
     14        comment on FD_SETSIZE in src/socket_win32.h to learn how to 
     15        increase this value if you need to connect to more than 64 
     16        servers. 
    1317 
    1418        Use poll() system call instead of select().  The latter has 
  • README

    r46fd4a rb495a1  
    2121The module should compile and work on any Unix-derived system.  Win32 
    2222support is based on the patch by Yasuhiro Matsumoto---thanks!, and is 
    23 (expected to be) supported by community. 
     23(expected to be) supported by community.  Note: on Win32 below Windows 
     24Vista max number of memcached servers is 64.  See comment on 
     25FD_SETSIZE in src/socket_win32.h to learn how to increase this value 
     26if you need to connect to more than 64 servers. 
    2427 
    2528Despite the low version number (which mainly reflects release history) 
  • src/poll_select.c

    rc346b2 rb495a1  
    2828#include "socket_win32.h" 
    2929#endif  /* WIN32 */ 
    30  
    31  
    32 int 
    33 can_poll_fd(int fd) 
    34 { 
    35   return (fd < FD_SETSIZE); 
    36 } 
    3730 
    3831 
  • src/poll_select.h

    rc346b2 rb495a1  
    3636 
    3737 
    38 extern 
    39 int 
    40 can_poll_fd(int fd); 
    41  
    42  
    4338struct pollfd 
    4439{ 
  • src/socket_posix.h

    rc346b2 rb495a1  
    4949#define poll(fds, nfds, timeout)  poll_select(fds, nfds, timeout) 
    5050 
     51#define can_poll_fd(fd)  ((fd) < FD_SETSIZE) 
     52 
    5153#endif  /* ! defined(HAVE_POLL_H) && ! defined(HAVE_SYS_POLL_H) */ 
    5254 
  • src/socket_win32.h

    rc346b2 rb495a1  
    3636#define poll(fds, nfds, timeout)  WSAPoll(fds, nfds, timeout) 
    3737 
    38 #define can_poll_fd(fd)  1 
    39  
    4038#else  /* ! (_WIN32_WINNT >= 0x0600) */ 
    4139 
     
    4543 
    4644#endif  /* ! (_WIN32_WINNT >= 0x0600) */ 
     45 
     46 
     47/* 
     48  On Win32 FD_SETSIZE is not the limit on the max fd value, but 
     49  instead the limit on the total number of fds that select() can 
     50  handle.  So can_poll_fd() should return 1 in any case, any fd is 
     51  select()'able or WSAPoll()'able.  By default FD_SETSIZE is 64.  If 
     52  you plan to use more memcached servers, you may redefine it to a 
     53  larger value before including <winsock2.h>. 
     54*/ 
     55#define can_poll_fd(fd)  1 
    4756 
    4857 
Note: See TracChangeset for help on using the changeset viewer.