摘要:
https://learn.microsoft.com/en-us/archive/msdn-magazine/2017/may/net-core-cross-platform-code-generation-with-roslyn-and-net-core https://www.tugberku 阅读全文
摘要:
C#的序列化库很多通过注解Attribute来实现,比如Protobuf-net,Messagepack等。如果手动添加注解,会比较麻烦,尤其在切换序列化库的时候,需要更改对应的注解。 这里实现了一个使用Mono.Cecil来自动添加注解的类,当程序编译后,会修改对应的dll来实现效果。 遇到的坑: 阅读全文
摘要:
最近用反射,想找到一个接口的父接口,发现baseType是null。 但是dotpeek反射里面显示是有baseType的。 搜了一下,意识到你只能 implement 一个接口,而不能inherit一个接口。所以一个接口想找到父接口应该再次使用GetInterfaces函数。 阅读全文
摘要:
《TCP/IP Illustrated Volume1 The Protocols》第14章的总结中提到 Karn’s algorithm removes the retransmission ambiguity problem by preventing the use of RTT measur 阅读全文
摘要:
简介 不管是RPC还是IPC,本质都是通过某种寻址方式调用另一个**工作单元(线程)**的函数(subroutine)。 此处工作单元可以是主机(host),进程(process),线程(thread)。最终函数将在某个主机上的某个进程里的某个线程中执行。 为了简化情况,我们假设一台主机上只运行一个 阅读全文
摘要:
one sees that word is defined to be 2 bytes (or 16 bits). It was given this meaning when the 8086 was first released. When the 80386 was developed, it 阅读全文
摘要:
网络发送数据包,现成的接口Socket.Send在我的电脑上大概会有700us左右的耗时,如果使用SendAsync开销会更大,并且会导致数据包的乱序。 Send阻塞接口慢的原因一方面底层会跑很多代码,另一方面有线程就有竞争,有竞争就有加锁。 于是写了一个轻量的Queue来加速网络发包,平均耗时从7 阅读全文
摘要:
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/caller-information C#获取调用方的信息,没找到类相关的信息 public void DoProcessing() { Tra 阅读全文
摘要:
###如果不设置DontFragment udpClient.DontFragment = false; 那么可以发送数据包。接收端随缘收到数据包。使用WireShark可以检测到网卡上对应的数据包。 如果设置DontFragment udpClient.DontFragment = true; 在 阅读全文
摘要:
https://keithbabinec.com/2018/06/12/how-to-capture-and-debug-net-application-crash-dumps-in-windows/ 默认情况下Windows Error Reporting会处理异常,可以用“事件查看器”查看。 可 阅读全文