Viewing File: /usr/lib64/python2.7/Demo/sockets/throughput.pyo

ó
V
Qc@s]ddlZddlZddlTd
ZdZd„Zd„Zd„Zd	„ZeƒdS(iÿÿÿÿN(t*iPÃi*icCsdttjƒdkrtƒntjddkr<tƒn$tjddkrYtƒntƒdS(Niis-ss-c(tlentsystargvtusagetservertclient(((s//usr/lib64/python2.7/Demo/sockets/throughput.pytmains


cCs'tjt_dGHdGHtjdƒdS(Ns*Usage:    (on host_A) throughput -s [port]s7and then: (on host_B) throughput -c count host_A [port]i(Rtstderrtstdouttexit(((s//usr/lib64/python2.7/Demo/sockets/throughput.pyR"scCsÑttjƒdkr+ttjdƒ}nt}tttƒ}|jd|fƒ|j	dƒdGHxe|j
ƒ\}\}}x|jtƒ}|sœPn~qƒ|j
dƒ|jƒdG|GdG|GHqhdS(NitisServer ready...sOK
s	Done withtport(RRRtevaltMY_PORTtsockettAF_INETtSOCK_STREAMtbindtlistentaccepttrecvtBUFSIZEtsendtclose(Rtstconnthostt
remoteporttdata((s//usr/lib64/python2.7/Demo/sockets/throughput.pyR)s"


cCs¬ttjƒdkrtƒntttjdƒƒ}tjd}ttjƒdkrpttjdƒ}nt}dtdd}tjƒ}t	t
tƒ}tjƒ}|j||fƒtjƒ}d}x'||krý|d}|j
|ƒq×W|jdƒtjƒ}	|jtƒ}
tjƒ}|
GHdG|G|G|G|	G|GHd	G||G||G|	|G||	GHd
G||GHdGtt|d||dƒGd
GHdS(Niiitxis
isRaw timers:s
Intervals:sTotal:sThroughput:gü©ñÒMbP?sK/sec.(RRRRtintR
RRttimeRRRtconnectRtshutdownRtround(tcountRRttestdatatt1Rtt2tt3titt4Rtt5((s//usr/lib64/python2.7/Demo/sockets/throughput.pyR>s6



%
!izÃ(	RR RRRRRRR(((s//usr/lib64/python2.7/Demo/sockets/throughput.pyt<module>s
				
Back to Directory File Manager