Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问有没有类似sendmmsg和recvmmsg的支持,或者其他加速小包(payloa在32~64 Bytes)发送的功能呢 #287

Open
zhiang28 opened this issue Apr 10, 2024 · 1 comment

Comments

@zhiang28
Copy link

zhiang28 commented Apr 10, 2024

我在ubuntu 22.04上运行,使用的是C,代码如下

#include <hpsocket/HPSocket4C.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(){
    HP_UdpNodeListener listener = Create_HP_UdpNodeListener();
    HP_UdpNode pNode = Create_HP_UdpNode(listener);
    HP_UdpNode_Start(pNode,"10.70.0.13",12345);

    const int dataSize = 32;
    const BYTE* pBuffer = (BYTE*)(const char[dataSize]){0};


    while(1)
        HP_UdpNode_Send(pNode,"10.70.0.14",12345,pBuffer,dataSize);

    HP_UdpNode_Stop(pNode);

    return 0;
}

根据测试,这份代码在我的平台上发包速率只能达到0.264M pps,而我其他使用sendmmsg或者python asyncio发包速率可以达到0.585M pps。三份代码的占用都是单个cpu 100%

还有一个问题,include HPSocket4C会提示wchar_t不存在,需要我在GlobalDef.h中添加#include <stddef.h>
感谢回答

@FunlyDay
Copy link

FunlyDay commented Apr 10, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants