SelectWrap.h 815 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2016 The ZLToolKit project authors. All Rights Reserved.
  3. *
  4. * This file is part of ZLToolKit(https://github.com/ZLMediaKit/ZLToolKit).
  5. *
  6. * Use of this source code is governed by MIT license that can be found in the
  7. * LICENSE file in the root of the source tree. All contributing project authors
  8. * may be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef SRC_POLLER_SELECTWRAP_H_
  11. #define SRC_POLLER_SELECTWRAP_H_
  12. #include "Util/util.h"
  13. namespace toolkit {
  14. class FdSet {
  15. public:
  16. FdSet();
  17. ~FdSet();
  18. void fdZero();
  19. void fdSet(int fd);
  20. void fdClr(int fd);
  21. bool isSet(int fd);
  22. void *_ptr;
  23. };
  24. int zl_select(int cnt, FdSet *read, FdSet *write, FdSet *err, struct timeval *tv);
  25. } /* namespace toolkit */
  26. #endif /* SRC_POLLER_SELECTWRAP_H_ */