UNIX C send() errno 14

早过忘川 提交于 2020-12-15 06:51:35

问题


I have this code:

void caller()
{
    char buffer[20][20];
    int sd;
    ...
    send(sd, buffer[7], 5, 0);
}

Now I have this code:

void funct(int sd, char **buffer)
{
    send(sd, buffer[7], 5, 0);
}
void caller()
{
    char buffer[20][20];
    int sd;
    ...
    funct(sd, buffer);
}

To simplify suppose that instead of ... I have an initialization of socket UDP and connection with the server to use send instead of sendto. I don't understand why the second code generates on send an error and errno is set with value 14, but the first work perfectly.

来源:https://stackoverflow.com/questions/64035362/unix-c-send-errno-14

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!