[En-Nut-Discussion] Very Slow Socket Reading

Ralph Mason ralph.mason at telogis.com
Sun Jun 29 06:27:43 CEST 2003


I was using a Socket and noticed it was running progressively slower and
slower.  So slow infact 4kb would basically never finish.

The code I was using was basically

while ( (i = fgetc(my_sock)) != EOF ){
	//Do some stuff.....
}

has anyone else had this problem?

Changing it to use a 256 byte buffer and using fread gave me a big boost in
speed, but the socket is IO not compute constrained so it shouldn't have
made any difference, it was like the fact I was reading it one char at a
time was throttling it exponentially more and more.

Any have any thought?

Thanks
Ralph

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003




More information about the En-Nut-Discussion mailing list