From: Petr T. <pto...@ss...> - 2002-10-28 22:10:04
|
From: "Ondrej Pecta" <oc...@ma...> > PT> - Proc tam je flazik tcp_send_immediately? Pokud uz tam ma byt, proc > PT> je jen u tcp a ne u udp? > > To send immediatelly je jen u TCP, pac nevidim duvod, proc to pouzivat > i tu UDP. proste u unlock() se v pripade tohoto nastaveneho flagu ihned > odesle. Neni problem dodelat to do UDP. Jen jsem nechapal, cim se lisi TCP od UDP, kdyz oboji posila netobuffery po siti, ale u TCP lze rict aby to poslal ihned, zatimco u UDP ne. Co se tyce vyuzitelnosti, vyssi vrstvy maji zakazano pouzivat to send_immediately, takze pro udp neni potreba dodelavat :-) > PT> - Proc se zavadel Network::StreamType, ktery jsem zacal pouzivat, kdyz > PT> vlastne > PT> nikde neni pouzivan v networku? > PT> Nemel by interface spis byt > > PT> NetOBuffer * lock( Streamtype type ); > PT> void unlock( NetObuffer * buffer ); > PT> ? > PT> TCP a UDP OBuffery stejne nedavaji zadny interface, ktery by > PT> byl vyssim vrstvam k uzitku. Zatim je rozliseni na TCP a UDP pro vyssi > PT> vrstvy > PT> jen kvuli tomu, aby to poznal network::unlock(). Spis bych dal typ do > PT> netobufferu, zda je to tcp nebo udp a unlock si to testne sam. > > Dobre, nabidl jsi 2 moznosti, jak stary lock ( "chybny" ) predelat. Tu > co mi ted pises, tu, jak ja jsem to provedl. > Nevim, proc jsi to tedy nenapsal hned, ze chces tuhle moznost. Mrkni > na starsi maily. No tohle nebylo mysleno "predelej to takhle", ale "kdyz nad tim tak uvazuju, tahle verse ma nektere pekne vyhody" a ty bys na to rekl "no vlastne jo, to musim hned predelat uz jen z principu, aby network byl lepsi" :-) Co se tyka vyuzitelnosti v massivu, muzes to nechat ve forme jake to je, protoze lock a unlock se dela pouze na jednom miste, cili vubec nevadi ruzne typy bufferu. Kdybych ale napriklad chtel aby jedna funkce locknula buffer, ale az jina ho unlocknula, byl by to problem, protoze bych ty funkce musel psat 2x pro dva typy bufferu - to uz by se to muselo predelat, takhle jak rikam je to v massivu jedno. Petr |