Tu trimiti toate argumentele ca un string pe care apoi il spargi in bucati in server cu strtok cu delimitatorul spatiu. Ce se intampla de exemplu cand fisierul pe care il ai de citit are spatii in nume? Ce se intampla daca primesti gunoaie de la un alt program?
<br><br>In principiu a folosi string-uri null terminated intr-un protocol este echivalent cu a te barbieri cu o sabie japoneza: se poate, dar daca supravietuiesti inseamna ca ai fost norocos...<br><br><div class="gmail_quote">
On Dec 10, 2007 9:59 PM, Dragos Sbarlea <<a 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;">Eu nu am situatia descrisa acolo, cel putin nu cred... Daca nu esti de acord, te rog corecteaza-ma:<br><br>Am doar un header, inclus inainte de date si cu lungime specificata. Asa nu se amesteca datele de control cu textul si daca mesajul nu are formatul specificat, pot detecta asta.
<br><br>Sunt in schimb multe alte probleme de implementare ( no platform independence ), o sa o schimb destul de mult...<div class="Ih2E3d"><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><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: "<a href="mailto:cosminratiu@gmail.com" target="_blank">cosminratiu@gmail.com</a>
" <<a href="mailto:cosminratiu@gmail.com" target="_blank">cosminratiu@gmail.com</a>><br>To: Sisteme de Operare <<a href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a>><br></div><div>
<div></div><div class="Wj3C7c">Sent: Monday, 10 December, 2007 8:34:25 PM<br>Subject: Re: [so] [t4]comportare ciudata aio_write<br><br>Cred ca protocolul folosit de tine nu este foarte bun, din motivele enumerate aici: <a rel="nofollow" href="http://cs.pub.ro/pipermail/so/2007-February/008967.html" target="_blank">
http://cs.pub.ro/pipermail/so/2007-February/008967.html</a><br><br>E bine sa fii paranoic cand scrii un protocol si sa te gandesti la tot ce se poate intampla, altfel te obisnuiesti sa ignori securitatea de la inceput.
<br><br><div class="gmail_quote">On Dec 10, 2007 7:06 PM, Dragos Sbarlea <<a rel="nofollow" href="mailto:sbarlead@yahoo.com" target="_blank">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;">Pai... nu :)
<br>For the record, ca sa nu faca si altii ca mine, aveti grija la compunerea pachetelor sa nu lasati "spatii libere" intre datele din primul si al doilea mesaj.<div><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><div>
<div>
</div><div><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: "<a rel="nofollow" href="mailto:cosminratiu@gmail.com" target="_blank">cosminratiu@gmail.com</a>" <<a rel="nofollow" href="mailto:cosminratiu@gmail.com" target="_blank">cosminratiu@gmail.com</a>>
<br>To: Sisteme de Operare <
<a rel="nofollow" href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a>><br>Sent: Monday, 10 December, 2007 6:10:20 PM<br>Subject: Re:
[so] [t4]comportare ciudata aio_write<br><br>De aici cumva?<br><br> printf("Bytesareonread4[%x][%x][%x]\n",*(packet_buf+1500),*(packet_buf+1501),*(packet_buf+1502));<br> printf("BytesareonWRITE[%x][%x][%x]\n",*(data+1478),*(data+1479),*(data+1480));
<br><br>:D.<br><br><br><div class="gmail_quote">On Dec 10, 2007 6:08 PM, Dragos Sbarlea <<a rel="nofollow" href="mailto:sbarlead@yahoo.com" target="_blank">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;">Don't mind me, problema era din toal alta parte :)<div><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><div><div></div><div><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: Dragos Sbarlea <<a rel="nofollow" href="mailto:sbarlead@yahoo.com" target="_blank">sbarlead@yahoo.com
</a>>
<br>To: <a rel="nofollow" href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a><br>Sent: Monday, 10 December, 2007 5:33:54 PM<br>Subject: [so] [t4]comportare ciudata aio_write<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 14pt;">
<br><div> Salut!<br><br>In testarea
temei 4 am ajus sa am urmatoarea problema: dau ca parametru functiei aio_write un vector in care pe pozitiile k, k+1 am niste valori diferite de 00. Verific asta prin afisare inainte de apel si dupa indeplinirea operatiei ( nu da eroare, am verificat cu aio_error ). Totusi, in fisier pe pozitiile k si k+1 apare 00 (in hexa :) ). Tot restul vectorului apare ok. Problema apare doar epntru vectori suficient de mari. Nu am resuit sa gasesc in manpages care este limita de lungime a vectorului pentru care aio_write functioneaza corect...
<br><br>Daca imi poate da cineva o idee de unde poate proveni comportamentul asta dubios, i-as fi recunosacator.<br><br></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><br></div></div><br>
<hr size="1">
Yahoo! Answers - Get better answers from someone who knows. <a rel="nofollow" href="http://uk.answers.yahoo.com/;_ylc=X3oDMTEydmViNG02BF9TAzIxMTQ3MTcxOTAEc2VjA21haWwEc2xrA3RhZ2xpbmU" target="_blank">Try
it now</a>.</div><br></div></div></div></div><div><br>
<hr size="1"> Sent from <a rel="nofollow" href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=51949/*http://uk.docs.yahoo.com/mail/winter07.html" target="_blank">Yahoo!</a> - a smarter inbox.
</div>
</div><br>_______________________________________________<br>so mailing list<br><a rel="nofollow" href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a><br><a rel="nofollow" href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br><br></blockquote></div><br>
</div><br></div></div></div></div><div><div></div><div><br>
<hr size="1"> Sent from <a rel="nofollow" href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=51949/*http://uk.docs.yahoo.com/mail/winter07.html" target="_blank">Yahoo!</a> - a smarter inbox.
</div>
</div></div><br>_______________________________________________<br>so mailing list<br><a rel="nofollow" href="mailto:so@cursuri.cs.pub.ro" target="_blank">so@cursuri.cs.pub.ro</a><br><a rel="nofollow" href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br><br></blockquote></div><br>
</div></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 href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=51947/*http://uk.promotions.yahoo.com/forgood/" target="_blank">
Yahoo! for Good</a>
</div></div><br>_______________________________________________<br>so mailing list<br><a href="mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</a><br><a href="http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so" target="_blank">
http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so</a><br><br></blockquote></div><br>