[so] [Tema 5]recv problems
Razvan Deaconescu
razvan.deaconescu at cs.pub.ro
Tue Jun 3 01:26:20 EEST 2008
On Mon, 2008-06-02 at 23:45 +0300, Bogdan Doinea wrote:
> salut!
>
> Am o problema cu functia recv.
>
> Imi setasem bufferul in client pe valoarea de 8192. Daca as fi primit
> mai multe date, pur si simplu faceam mai multe recv-uri in loop (pe
> care oricum trebuie sa le fac in cazul real in care daca as folosi
> protocolul in retea, si serverul nu ar trimite toate datelel la send,
> trebuie sa fac recv in client pana primesc tot).
Salut, Bogdan!
Orice socket are limitari impuse de nucleul sistemului de operare. In
particular un socket are un buffer de citire (receive) si unul de
scriere (send).
In cazul tau, bufferul de receive este limitat la 8192.
Poti modifica buffer-ul de send/receive folosind setsockopt(2) [1]. Mai
multe informatii se gasesc in pagina de manual socket(7) [2].
Razvan
[1] http://www.kernel.org/doc/man-pages/online/pages/man2/setsockopt.2.html
[2] http://www.kernel.org/doc/man-pages/online/pages/man7/socket.7.html
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the so
mailing list