我如何發送接受的套接字的功能參數這裏是代碼:我如何發送接受插座的功能作爲參數
//accept connection
accept_sock = accept(sock_con,(struct sockaddr *)&info,&sizeof_accept);
//Create a new process
int pid = fork();
if (pid == 0)
{
//close the socket
close(sock_con);
request_handle(accept_sock); ** here i wanna send the socket to that function*
}
什麼是宣佈這個功能時,該插座的數據類型?
function request_handle(what is the datatype pointed here){
}
你是怎麼解決申報'accept_sock'不知道它的類型?你在'accept'的手冊頁上讀到了什麼? – Mat
他可能會複製代碼,甚至沒有機會閱讀它。 –
這只是我的第一次編程經驗,我只是嘗試通過練習來學習 – kingasmk