Unix Domain : connect() : No such file or directory

前端 未结 2 1679
闹比i
闹比i 2021-01-12 07:05

as stated in the title, my connect() call to an unix domain type socket with an according address results in the error ENOENT: no such file or directory

2条回答
  •  天命终不由人
    2021-01-12 07:28

    After figuring out that I was handling the sockets properly, I altered my code for connect() a little and now it works. I just added this line after the declaration of my variable:

    memset(&address, 0, sizeof(struct sockaddr_un));
    

    Does anyone know why I need to set the whole variable to 0 to make it work? Should I ask this in a new topic or can I ask this here?

提交回复
热议问题