[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Test af TCP server: korrekt håndtering af read(2)



Jeg sidder og skriver test for en tcp server der implementerer en
HTTP-lignende protokol.

Serveren læser fra netværket i 4K blokke og nu vil jeg gerne teste at
den korrekt håndterer forskellige grænsetilfælde hvor requests ikke ikke
passer pænt sammen med hvornår read(2) returnerer data.

Det vil sige at jeg har to processer der taler sammen via tcp på
så vil jeg gerne opnå noget ala følgende:

 C: write("... 234 bytes ...")
 S: read("... 234 bytes ...")
 S: processing bytes
 C: write("... 142 bytes ...")
 S: read("... 142 bytes ...")
 S: processing bytes

I stedet for

 C: write("... 234 bytes ...")
 C: write("... 142 bytes ...")
 S: read("... 376 bytes ...")
 S: processing bytes


Jeg kunne indsætte passende sleep kald i klienten for at emulere
netværks latency, men det vil gøre at min test-suite bliver meget
sløv. Nogen der har andre bud?

I øjeblikekt laver jeg skumle ting hvor jeg kører serveren med en
ikke-standard read() metode. Men den er lidt besærlig at overbevise
upstream om er helt fin.

//Makholm
 


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2012-08-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *