Daimones, skotomoi, anilika tekna kai anamoni
Dimitrios Stasinopoulos
dimitris at linea.gr
Mon Mar 11 17:16:01 EET 2002
Paides xaireto()
Mias kai to thema thixtike sxetika prosfata, eipa na rikso kai ego ena
thema pros sizitisi.
Esto daimonas pou anamenei gia sindeseis se 2 diaforetika ports (UDP to
ena, TCP to allo), kai xrisimopoiei tin select() gia na dei se poio
iparxei sindesi. Me to pou vlepei sindesi, kanei fork(), to neogno
daimonio (pou omos den einai daimonas) alambanei na ferei se peras tin
apostoli tis sindesis, sinomilias ktl, eno o mpampas daimonas me loop
ksanakouei gia daimonikes epikliseis.
Koinos:
while(1)
{
select()
fork
if(in_child)
{
handle connection();
exit(0);
}
}
To provlima bebaia edo einai oti meta apo ligo to process table ginetai
xeirotero apo nekrotafeio pou tou exei ginei spell mass summon zombies :)
An loipon valoume ena wait4(), iparxei to provlima oti o mpampas tha
perimenei pos kai pos na pethanei to mikro (kai xaritomeno tolmo na po)
daimonio prin ksanakousei gia epikliseis (aparadekto, skefteite olous tous
talaiporimenous satanistes), eno an poume stin wait4() na kanei WNOHANG,
poli apla stin praksi merika daimonia diafevgoun tis anamonis tou mpampa
daimona kai sapizoun ston paradeiso mexri na pethanei kai o mpampas.
To zitima einai to eksis: Pos kanoume ton mpampa na pairnei ola ta exit
codes ton mpompiron daimonion oste na min ginontai zombies, eno taftoxrona
na akouei kai gia pithanes epikliseis?
Ennoeitai oti to SIG_CHLD to ksaname all together logo select().
Dimitris Stasinopoulos
More information about the Linux-greek-users
mailing list