Changed set_keepalive to return 2 if the connection must be conditonally closed. Plus tests and documentation.