UDP “Connect”-Speed in C#

后端 未结 2 1022
孤独总比滥情好
孤独总比滥情好 2021-01-21 05:56

I profiled some boilerplate UDP code and the speed was very good for sending only some small amount data (which is my intent).

BUT the \"connect\" method is \"very slow\

2条回答
  •  终归单人心
    2021-01-21 06:05

    I have come to the following conlusion:

    There is no way to make UDP faster with C#. UdpClient with standard MSDN samples is the best choice.

    I found a wrapper for the core API of winsock: http://www.elitepvpers.com/forum/co2-programming/159327-advanced-winsock-c.html

    But when you hit "connect" (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms737625(v=vs.85).aspx) the speed is rougly the same as with the managed UdpClient.

提交回复
热议问题