One socket is the command side and the other socket is the data side. How to inform the data side to accept the end?

write a client, of FTP using passive mode. After the data socket for transmission is established, how does the socket for the command inform data socket??

// 
int client_data_socket = get_client_data_socket(client_cmd_port);
sprintf(send_buffer, "PASV\r\n");
send_cmd(client_socket, send_buffer);
 // 227
length = get_respond(client_socket, recv_buffer, argv[1]);
if (!is_correct_respond(recv_buffer, 227))
{
    printf("enter passive mode failed\n");
    continue;
}
unsigned int server_data_port = cal_data_port(recv_buffer); // 
connect_server(client_data_socket, argv[1], server_data_port);

sprintf(send_buffer, "LIST %s\r\n", "");
send_cmd(client_socket, send_buffer);

// 125 226
length = get_respond(client_socket, recv_buffer, argv[1]);
if (!is_correct_respond(recv_buffer, 125))
{
    printf("LIST start failed\n");
    continue;
}
// ...

my idea:
client_socket (socket used to accept commands) just use get_respond , block there, wait until receiving the 226command, and client_data_socket should start a process or thread, client_data_socket should also be changed to non-blocking (otherwise it will block if you can"t read the data), when the client_socket sends to end the command, return the data

.
Mar.16,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-1b36f4e-2c063.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-1b36f4e-2c063.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?