Added ability to pass the keepalive parameter into the extended class.