| 41 | } |
| 42 | |
| 43 | void CharIOHandler::readBytePoll(int fd, unsigned int &data, bool &available) { |
| 44 | char ch; |
| 45 | qint64 res; |
| 46 | if (!fd_specific || fd_list.contains(fd)) { |
| 47 | if (bytesAvailable() > 0) { |
| 48 | res = read(&ch, 1); |
| 49 | if (res > 0) { |
| 50 | data = ch & 0xff; |
| 51 | available = true; |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | void CharIOHandler::insertFd(const int &fd) { |
| 58 | fd_list.insert(fd); |