<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:14pt">Yup, dar, din ce am citit POSIX spune ca fcntl se foloseste pentru asta...<br><div> </div>Dragos Dumitru Sbîrlea<br><span style="color: rgb(91, 91, 91);">Facultatea de Automatica si Calculatoare</span><br style="color: rgb(91, 91, 91);"><span style="color: rgb(91, 91, 91);">Universitatea Politehnica din Bucuresti</span><div style="font-family: times new roman,new york,times,serif; font-size: 14pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: "cosminratiu@gmail.com" <cosminratiu@gmail.com><br>To: Sisteme de Operare <so@cursuri.cs.pub.ro><br>Sent: Monday, 10 December, 2007 8:31:14 PM<br>Subject: Re: [so] [Tema4] Operatii asincrone<br><br>Mai simplu este cu ioctl cu FIONBIO, asa cum e in
laborator.<br><br><pre>//puts a socket in nonblocking mode<br>void set_nonblocking(int s)<br>{<br>        int m = 1;<br>        ioctl(s, FIONBIO, &m);<br>}<br></pre><br><br><div class="gmail_quote">
On Dec 10, 2007 7:19 PM, Dragos Sbarlea <<a rel="nofollow" ymailto="mailto:sbarlead@yahoo.com" target="_blank" href="mailto:sbarlead@yahoo.com">sbarlead@yahoo.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: times new roman,new york,times,serif; font-size: 14pt;">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. :)
<br><br>Cum celelalte flaguri nu prea se pot folosi la socketi cred ca e ok si asa, dar cine stie...<br><br> Dragos Dumitru Sbîrlea<br><span style="color: rgb(91, 91, 91);">Facultatea de Automatica si Calculatoare</span>
<br style="color: rgb(91, 91, 91);"><span style="color: rgb(91, 91, 91);">Universitatea Politehnica din Bucuresti</span><div style="font-family: times new roman,new york,times,serif; font-size: 14pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div class="Ih2E3d">----- Original Message ----<br>From: Iulian Moraru <<a rel="nofollow" ymailto="mailto:iulian@gmail.com" target="_blank" href="mailto:iulian@gmail.com">iulian@gmail.com</a>><br>To: Sisteme de Operare
<<a rel="nofollow" ymailto="mailto:so@cursuri.cs.pub.ro" target="_blank" href="mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a>><br>Sent: Monday, 10 December, 2007 2:00:58 PM<br>Subject: Re: [so] [Tema4] Operatii asincrone<br><br>On Dec 10, 2007 1:40 PM, Alexandru-Mihai Carp <
<a rel="nofollow" ymailto="mailto:carpalex@gmail.com" target="_blank" href="mailto:carpalex@gmail.com">carpalex@gmail.com</a>>
wrote:<br>> Lucian Adrian Grijincu wrote:<br>> ><br>> > Pentru socketi trebuie folosite operatii non-blocante.<br>> ><br>> ><br>> Pai read / write sau recv / send sunt blocante, daca nu stim cat avem
de<br>> trimis / primit.<br>> Singura modalitatate de a fi non-blocante e sa ne asiguram ca nu
citim<br>> mai mult decat ni s-a trimis, nu?<br><br>Faci ca socketul sa fie non-blocant cu fcntl, comanda F_SETFL si<br>flagul O_NONBLOCK. Pe urma read, write, send si recv se vor comporta<br>diferit (cauta EAGAIN in paginile lor de manual).
<br><br>Iulian<br><br><br><br>> _______________________________________________<br></div><div class="Ih2E3d">> so mailing list<br>> <a rel="nofollow" ymailto="mailto:so@cursuri.cs.pub.ro" target="_blank" href="mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a><br>
> <a rel="nofollow" target="_blank" href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br>><br>_______________________________________________<br>so mailing list<br>
<a rel="nofollow" ymailto="mailto:so@cursuri.cs.pub.ro" target="_blank" href="mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a><br><a rel="nofollow" target="_blank" href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so">http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br>
</div></div><div class="WgoR0d"><br></div></div></div><div class="WgoR0d"><br>
<hr size="1"> Support the World Aids Awareness campaign this month with <a rel="nofollow" target="_blank" href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=51947/*http://uk.promotions.yahoo.com/forgood/">
Yahoo! for Good</a>
</div></div><br>_______________________________________________<br>so mailing list<br><a rel="nofollow" ymailto="mailto:so@cursuri.cs.pub.ro" target="_blank" href="mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a><br><a rel="nofollow" target="_blank" href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so">
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br><br></blockquote></div><br>
</div><br></div></div><br>
<hr size=1> Support the World Aids Awareness campaign this month with <a href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=51947/*http://uk.promotions.yahoo.com/forgood/">Yahoo! for Good</a>
</body></html>