Recvfrom returns Invalid argument?

Under what circumstances will

recvfrom return Invalid argument?
I have set the last two parameters to nullptr , but this still happens

.

the general process is as follows:

class socketTCP 
{
public:
 //...
private:
    int fdTCP;
    int fdUDP;
};
bind
int socketTCP::Bind(const char* ip, int port) 
{
    struct sockaddr_in addr;
    memset(&addr, 0, sizeof(addr));
    addr.sin_family = AF_INET;
    addr.sin_port = htons(port);
    inet_pton(AF_INET, ip, &addr.sin_addr);
  
    int res = bind(fdTCP, (struct sockaddr*)&addr, sizeof(addr));
    res = bind(fdUDP, (struct sockaddr*)&addr, sizeof(addr));
   
    
    return 0;
}
 udp sockfd 
void socketBus::inform(const char* ip, int port, int* tmp) 
{
    int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
    struct sockaddr_in addr;
    memset(&addr, 0, sizeof(addr));
    addr.sin_family = AF_INET;
    addr.sin_port = htons(port);
    addr.sin_addr.s_addr = inet_addr(ip);
    
    sendto(sockfd, (void *)&buffer, sizeof(buffer), 0, (struct sockaddr*)&addr, sizeof(addr));
    close(sockfd);
}
//bindudp sockfd 
//getMysockfd(1) return fdUDP
void socketBus::recvFrom(int* buf, int length) 
{
    int udpfd = getMysockfd(1); 
    int ret = recvfrom(udpfd, (void *)buf, length, 0, nullptr, nullptr);
  
}

however, Invalid argument error
is thrown in this recvfrom. Why

Dec.24,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35f0c-2b81e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35f0c-2b81e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?