[so] [Tema4] Operatii asincrone
Dragos Sbarlea
sbarlead at yahoo.com
Mon Dec 10 20:49:52 EET 2007
Yup, dar, din ce am citit POSIX spune ca fcntl se foloseste pentru asta...
Dragos Dumitru Sbîrlea
Facultatea de Automatica si Calculatoare
Universitatea Politehnica din Bucuresti
----- Original Message ----
From: "cosminratiu at gmail.com" <cosminratiu at gmail.com>
To: Sisteme de Operare <so at cursuri.cs.pub.ro>
Sent: Monday, 10 December, 2007 8:31:14 PM
Subject: Re: [so] [Tema4] Operatii asincrone
Mai simplu este cu ioctl cu FIONBIO, asa cum e in laborator.
//puts a socket in nonblocking mode
void set_nonblocking(int s)
{
int m = 1;
ioctl(s, FIONBIO, &m);
}
On Dec 10, 2007 7:19 PM, Dragos Sbarlea <sbarlead at yahoo.com> wrote:
Ca sa fim chitibusari (sau iubitori de corectitudine) ar trebui mai intai sa luam flagurile curente (F_GETFL) pentru socket si apoi sa adaugam flagul O_NONBLOCK. :)
Cum celelalte flaguri nu prea se pot folosi la socketi cred ca e ok si asa, dar cine stie...
Dragos Dumitru Sbîrlea
Facultatea de Automatica si Calculatoare
Universitatea Politehnica din Bucuresti
----- Original Message ----
From: Iulian Moraru <iulian at gmail.com>
To: Sisteme de Operare
<so at cursuri.cs.pub.ro>
Sent: Monday, 10 December, 2007 2:00:58 PM
Subject: Re: [so] [Tema4] Operatii asincrone
On Dec 10, 2007 1:40 PM, Alexandru-Mihai Carp <
carpalex at gmail.com>
wrote:
> Lucian Adrian Grijincu wrote:
> >
> > Pentru socketi trebuie folosite operatii non-blocante.
> >
> >
> Pai read / write sau recv / send sunt blocante, daca nu stim cat avem
de
> trimis / primit.
> Singura modalitatate de a fi non-blocante e sa ne asiguram ca nu
citim
> mai mult decat ni s-a trimis, nu?
Faci ca socketul sa fie non-blocant cu fcntl, comanda F_SETFL si
flagul O_NONBLOCK. Pe urma read, write, send si recv se vor comporta
diferit (cauta EAGAIN in paginile lor de manual).
Iulian
> _______________________________________________
> so mailing list
> so at cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so
>
_______________________________________________
so mailing list
so at cursuri.cs.pub.ro
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so
Support the World Aids Awareness campaign this month with
Yahoo! for Good
_______________________________________________
so mailing list
so at cursuri.cs.pub.ro
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so
___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/so/attachments/20071210/e2a7cb7d/attachment.htm
More information about the so
mailing list