programovani socketu

Petr Baudis pasky na pasky.ji.cz
Středa Srpen 8 10:23:35 CEST 2001


> > 1.Jak zmerit, s presnosti na 1/10s cas, ktery uplyne mezi connect(socket,.....)
> > a skutecnym navazanim spojeni se vzdalenym serverem?
> 
> 	Pouzijte asynchronni pristup nebo pres signal SIG_ALARM a nebo pres
> klasicke time... - vse s pomerne dobrou presnosti... - presnost pod 1s
> IMHO neni dle POSIX mozna, kazdy system implementuje sve rozsireni po
> svem... a pokud budete hodne brutalni, nepochybne mate v jadre
> zakompilovanou podporu RTC...;-)
man usleep
Jeste trochu portabilnejsi asi bude pouziti onoho select()u - nesledovat
zadne fd, jen nastavit timeout - tam je take s presnosti na mikrosekundy.


-- 

				Petr "Pasky" Baudis
.                                                                    .
Whoever coded that patch should be taken out and shot, hung, drawn and
quartered then forced to write COBOL for the rest of their natural
life.
  -- Keith Owens <kaos na ocs.com.au> in linux-kernel
.                                                                    .
My public PGP key is on: http://pasky.ji.cz/~pasky/pubkey.txt
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d- s++:++ a--- C+++ UL++++$ P+ L+++ E--- W+ N !o K- w-- !O M-
!V PS+ !PE Y+ PGP+>++ t+ 5 X(+) R++ tv- b+ DI(+) D+ G e-> h! r% y?
------END GEEK CODE BLOCK------


Další informace o konferenci Linux