httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sorin Manolache <sor...@gmail.com>
Subject Re: Protocol converter module
Date Tue, 05 Jun 2012 12:09:39 GMT
On 2012-06-05 13:47, Robert Mitschke wrote:
> How do I go about implementing this select. I have searched through the
> code but could not find out a way to actually get a handle to the socket.
> In the code all that is handled are network buckets. How would I gain
> access to the socket handle in process_connection? I would need that handle
> to select on it.
>

Place a callback on the pre_connection hook. The 2nd argument to 
pre_connection is an apr_socket_t.

int
pre_connection_callback(conn_rec *c, void *sock) {
    apr_os_sock_t os_fd;
    apr_os_sock_get(&os_fd, (apr_socket_t *)sock);
    // store os_fd somehwere (for example in your c->conn_config)
    // os_fd is your socket descriptor
    return OK;
}

Mime
View raw message