This class allow to create an object client. This client establish the number of connection, indicate while the object creation. The connection execute the same function to calculate bandwidth between interval and during the total duration.
Constructor:
new_client = ClientTCP()
Function:
initialization() runClient() formatValue() Client() bandwidthTCPDownload() bandwidthTCPDownload() stopClient()
Constuctor of this class. The constructor take 6 arguments to create an ClientTCP object.
Argument : |
|
---|
example
>>> ClI_TCP=ClientTCP(address,connection,interval,duration,upload,download)
>>> CLI_TCP.runClient()
This function is executed by the created processes to measure the bandwidth. Each process determine the first index of the shared memory area between the processes, to enter the values measured. Processes run “bandwidthTCPUpload” and / or “bandwidthTCPDownload” functions, after that booleans values, “upload” and “download”, are tested.
Argument : |
|
---|
This function allow to initialize the connection with the server, then run a loop to receive data of the server. This loop calculate the bandwidth on each interval and during the length of the measure and fill the shared memory area. At the end, this function close the socket.
Argument : |
|
---|
This function allow to initialize the connection with the server, then run a loop to send data to the server. This loop calculate the bandwidth on each interval and during the length of the measure and fill the shared memory area. At the end, this function close the socket.
Argument : |
|
---|
This function allow to format the list passed in argument to the good format.
Argument : |
|
---|---|
Return : | A String list with the rigth unit for the bandwidth. [ “inta+int1 Mbits/s”, “intb+int2 Mbits/s”, “intc+int3 Kbits/s”] |
This function allow to create the TCP socket and connection with the address specified in the constructor. After that, client programm send to the server the common parameters (interval, duration, direction). The answer’s server is an number to identify the client (“self.ID”).
Argument : |
|
---|