学习随记
1.Lambda
Invoke(new Action<object>(o=>{/*方法体*/}));
2.Debug&Track
.Assert(), .WriteLine()+DbgView
3.HashTable之类键值集合,直接使用 coll.Values 遍历
4.Socket服务器主动侦测掉线
Socket sock = new Socket(AddressFamily.InterNetwork,SocketType.Stream, ProtocolType.Tcp);
int keepAlive = -1744830460; // SIO_KEEPALIVE_VALS
byte[] inValue = new byte[] { 1, 0, 0, 0, 0x10, 0x27, 0, 0, 0xe8, 0x03, 0, 0 }; // True, 10秒, 1 秒
sock.IOControl(keepAlive, inValue, null);
5.List初始化的时候分配一个值