programovaci problem

Michal Mertl mime at traveller.cz
Fri Aug 25 11:03:15 CEST 2000


Pisu takovy programek v C a chovani FreeBSD mi prijde divne.

Mam klienta a servera co se spoji TCP a posilaji si po tom socketu neco
jako ping. Na localhostu to smerem od serveru trva cca 0.2ms a druhym
smerem radove vic. Pri kazdem spusteni klienta chodi jednotlive odpovedi
zhruba stejne rychle, ale pri ruznych spustenich ruzne.

(napr.
>./nibcli
Connecting to localhost
Connected!
echo took 0.001366 sec
echo took 0.001176 sec

>./nibcli
Connecting to localhost
Connected!
echo took 0.070173 sec
echo took 0.070187 sec
echo took 0.070175 sec
)

Na OpenBSD to trva pokazde stejne a to stejne jako druhym smerem a to asi
0.2ms.

Zkousel jsem FreeBSD 3.4 a 4.1-STABLE a OpenBSD 2.6.

Klient i server jsou zhruba toto:
while (1) {	
	cti_socket   // blocking select, pokud prijde echo_request
		     // okamzite odpovez
	if (posli_dalsi_echo_request) // rizeno itimerem
		posli_echo_request
}


Pokud neznate odpoved, napiste mi prosim aspon, kde jinde bych se mohl
zeptat (freebsd-questions?).

Pokud je treba, muzu tu vec poslat nebo detailne popsat.

Dik.

-- 
Michal Mertl
mime at traveller.cz




More information about the Users-l mailing list