Ejemplo n.º 1
0
void SslAcceptorTmpl<T>::readable(DispatchHandle& h) {
    Socket* s;
    do {
        errno = 0;
        // TODO: Currently we ignore the peers address, perhaps we should
        // log it or use it for connection acceptance.
        try {
            s = socket.accept();
            if (s) {
                acceptedCallback(*s);
            } else {
                break;
            }
        } catch (const std::exception& e) {
            QPID_LOG(error, "Could not accept socket: " << e.what());
        }
    } while (true);

    h.rewatch();
}
Ejemplo n.º 2
0
void reader(DispatchHandle& h, int fd) {
    readBytes += readALot(fd);
    h.rewatch();
}
Ejemplo n.º 3
0
void writer(DispatchHandle& h, int fd, const string& s) {
    writtenBytes += writeALot(fd, s);
    h.rewatch();
}