2018年11月27日星期二

C++ Builder 2009 Types 命名空间类型

C++ Builder 2009 Types 命名空间类型
是其所有 VCL 类中方法的参数类型:
Name 
Description 
DWORD is equivalent to LongWord. 
PByte is a pointer to a Byte variable. 
PDouble is a pointer to a Double variable. 
PInteger is a pointer to a Integer variable. 
This is type Types.PLongint. 
PPoint is a pointer to a TPoint variable. 
PRect is a pointer to a TRect variable. 
PSize is a pointer to a TSize variable. 
This is type Types.PSmallInt. 
This is type Types.PSmallPoint. 
SIZE 
This is type Types.SIZE. 
This is type Types.tagPOINT. 
TBooleanDynArray defines an array of Boolean elements. 
This is type Types.TByteDynArray. 
TCardinalDynArray defines an array of Cardinal elements. 
TDoubleDynArray defines an array of Double elements. 
TInt64DynArray defines an array of Int64 elements. 
This is type Types.TIntegerDynArray. 
TLongWordDynArray defines an array of LongWord elements. 
TShortIntDynArray defines an array of ShortInt elements. 
TSingleDynArray defines an array of Single elements. 
TSize represents a width and height. 
TSmallIntDynArray defines an array of SmallInt elements. 
TStringDynArray defines an array of String elements. 
TValueRelationship defines value comparison possibilities. 
TWideStringDynArray defines an array of WideString elements. 
TWordDynArray defines an array of Word elements.


TStringList

2018年11月15日星期四

nf_conntrack: table full, dropping packet

https://testerhome.com/topics/7509

# 在64位下,当CONNTRACK_MAX为 1048576,HASHSIZE 为 262144 时,最多占350多MB
# 对现在的机器来说毫无压力

推荐bucket至少 262144,max至少 1048576,不够再继续加

net.netfilter.nf_conntrack_tcp_timeout_established  # 默认 432000 秒(5天)
# 理论上不用这么长,不小于 net.ipv4.tcp_keepalive_time 就行了

# net.netfilter.nf_conntrack_buckets 不能直接改(报错)
# 需要修改模块的设置:
echo 262144 > /sys/module/nf_conntrack/parameters/hashsize
# 如果不是root:
echo 262144 | sudo tee /sys/module/nf_conntrack/parameters/hashsize

# 再查看,bucket已经变成设置的大小
sudo sysctl net.netfilter.nf_conntrack_buckets

# max设为桶的4倍
sudo sysctl -w net.netfilter.nf_conntrack_max=1048576
suod sysctl -w net.nf_conntrack_max=1048576
sudo sysctl -w net.netfilter.nf_conntrack_tcp_timeout_fin_wait=30
sudo sysctl -w net.netfilter.nf_conntrack_tcp_timeout_time_wait=30
sudo sysctl -w net.netfilter.nf_conntrack_tcp_timeout_close_wait=15

sudo sysctl -w net.netfilter.nf_conntrack_tcp_timeout_established=300