<commit_before>/*
 * misc.h
 *
 *  Created on: Sep 23, 2017
 *      Author: root
 */

#ifndef MISC_H_
#define MISC_H_


#include "common.h"
#include "log.h"
#include "network.h"

extern int hb_mode;

const u32_t max_handshake_conn_num=10000;
const u32_t max_ready_conn_num=1000;
const u32_t anti_replay_window_size=4000;
const int max_conv_num=10000;

const u32_t client_handshake_timeout=5000;//unit ms
const u32_t client_retry_interval=1000;//ms

const u32_t server_handshake_timeout=client_handshake_timeout+5000;// this should be longer than clients. client retry initially ,server retry passtively

const int conv_clear_ratio=20;  //conv grabage collecter check 1/20 of all conv one time
const int conn_clear_ratio=40;
const int conv_clear_min=1;
const int conn_clear_min=1;

const u32_t conv_clear_interval=1000;//ms
const u32_t conn_clear_interval=1000;//ms


const i32_t max_fail_time=0;//disable

const u32_t heartbeat_interval=500;//ms

const u32_t timer_interval=600;//ms. this should be smaller than heartbeat_interval and retry interval;

const uint32_t conv_timeout=120000; //ms. 120 second
//const u32_t conv_timeout=30000; //for test

const u32_t client_conn_timeout=10000;//ms.
const u32_t client_conn_uplink_timeout=client_conn_timeout+2000;//ms

const uint32_t server_conn_timeout=conv_timeout+60000;//ms. this should be 60s+ longer than conv_timeout,so that conv_manager can destruct convs gradually,to avoid latency glicth<commit_msg>tuned parameter<commit_after>/*
 * misc.h
 *
 *  Created on: Sep 23, 2017
 *      Author: root
 */

#ifndef MISC_H_
#define MISC_H_


#include "common.h"
#include "log.h"
#include "network.h"

extern int hb_mode;

const u32_t max_handshake_conn_num=10000;
const u32_t max_ready_conn_num=1000;
const u32_t anti_replay_window_size=4000;
const int max_conv_num=10000;

const u32_t client_handshake_timeout=5000;//unit ms
const u32_t client_retry_interval=1000;//ms

const u32_t server_handshake_timeout=client_handshake_timeout+5000;// this should be longer than clients. client retry initially ,server retry passtively

const int conv_clear_ratio=30;  //conv grabage collecter check 1/30 of all conv one time
const int conn_clear_ratio=50;
const int conv_clear_min=1;
const int conn_clear_min=1;

const u32_t conv_clear_interval=1000;//ms
const u32_t conn_clear_interval=1000;//ms


const i32_t max_fail_time=0;//disable

const u32_t heartbeat_interval=600;//ms

const u32_t timer_interval=400;//ms. this should be smaller than heartbeat_interval and retry interval;

const uint32_t conv_timeout=120000; //ms. 120 second
//const u32_t conv_timeout=30000; //for test

const u32_t client_conn_timeout=10000;//ms.
const u32_t client_conn_uplink_timeout=client_conn_timeout+2000;//ms

const uint32_t server_conn_timeout=conv_timeout+60000;//ms. this should be 60s+ longer than conv_timeout,so that conv_manager can destruct convs gradually,to avoid latency glicth
{'fraction_non_alphanumeric': 0.07967032967032966, 'fraction_numerical': 0.08379120879120878, 'mean_word_length': 5.838028169014085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3117021', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1020, 'n_words': 276}