REQ: Help on server testing

Antonis Kanavouras ankan at delirio.gr
Fri Aug 30 16:56:01 EEST 2002


> Oxi... Gia kathe write skopeveis na ftiaxneis neo thread to opoio na
psofaei ?
> Gia na stilei diladi 1K se komatia tvn 10bytes tha ftiakseis 100 threads?
>
> O kathe client exei toys dikoys toy I/O buffers.
> H diadikasi einai:
>
> init();
> while (1)
> main_loop();
>
> opoy main_loop():
>
> select()/poll()
> analogos me ta apotelesmata toys:
> do_reads() - check_input_buffers()
> do_writes()
>
> to do_reads diabazei apo kathe socket poy exei data symfvna me ta results
tis
> select/poll kai ta bazei se enan input buffer.
>
> Sthn synexeia kaleitai h check_input_buffers h opoia psaxnei gia oloklires
> grammes stoys input buffers kai tis epeksergazetai katallila. Kalo einai
ayto
> na syniparxei me to proigoyme stadio oste molis diabazeis dedomena apo ena
> socket na koitas amesvs gia oloklires grammes kai na min prepei na ta
> saroseis ola mazi sto telos.
>
> Otan thes na grapseis kati kaleis tin write_to_client_buf() h opoia den
grafei
> tipota sto socket kai apla bazei ta dedomena poy theleis na stileis ston
> katallilo output buffer.
>
> Afoy teleioseis me ola ta sockets poy eixan data gia diabasma kaleis tin
> do_writes h opoia symfvna me ta apotelesmata ths select/poll grafei se osa
> sockets itan diathesima osa data mporei kai ta sbinei apo toys buffers...
> Oti apomenei tha grafei molis ta sockets ayta ksanaginoyn etoima gia
grapsimo,
> se epomeno kyklo ths main_loop diladi.
>

Ayto  akrivws ginetai twra :-)





More information about the Linux-greek-users mailing list