Internet Server

Bassoukos Tassos abas at aix.meng.auth.gr
Fri Dec 4 18:40:39 EET 1998


On Fri, 4 Dec 1998, Michael wrote:

> HI se olous ...
>  
> Thelw na ftiaxw ena daemon gia TCP port . Kserw pws na xrhsimopoihsw
> tis socket functions alla exw to exhs problem :
>  
> Otan kalw thn accept() , o server tha kollhsei mexri na yparxei kapia
> incoming connection . Yparxei kapios tropos ( ektos apo thn select() ,
> giati etsi to programma tha prepei na diavazei synexws to socket ) , na
> kaleitai aytomata mia synarthsh tou programmatos otan to socket exei
> etoimh incoming connection ?
> 
> ThankX
> 

Hm...
Treis periptwseis:
1) ean xreishmopoieis forked server (pou meta thn syndesh na kanei fork
   kai na synexizei sto neo process), den xreiazesai select, giati to
   kyriws programma to mono pou 8a kanei einai na perimenei gia syndeseis.
2) ean xrhsimopoieis threads, aplws 8a exeis ena thread pou 8a perimenei
   sthn accept, kai 8a dhmiourgei nea threads gia na exyphrethsoun thn
   syndesh.
3) ean xrhsimopoieis enan monolithiko server, tote outws h allws 8a exeis
   kapou ekei mesa mia select (me h xwris timer), gia na perimenei gia
   dedomena apo/pros ton client, opote aplws pros8eteis to listening
   socket fd sto fd_set gia diabasma.

Ti akribws 8es na kaneis ? (mallon pws 8es na to kaneis ?)

Tassos

PS: periptwsh 1 einai poly kalh otan den yparxei ka8olou epikoinwnia
    meta3y twn clients (px ftpd)[0], h 2 einai kalh otan xreiazetai mia
    mikrhs ta3hs epikoinwnia meta3y twn threads, kai h tria einai otan
    yparxei megalh epikoinwnia meta3y twn clients.

[0] nai, 3erw xrhsimopoieitai synh8ws inetd... 
-- 
Bassoukos Tassos

There are only two industries that call their customers "users" - Dan_K
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hellug.gr/pipermail/linux-greek-users/attachments/19981204/519e161f/attachment.htm>


More information about the Linux-greek-users mailing list