-
Notifications
You must be signed in to change notification settings - Fork 0
/
TCP_main_client.py
32 lines (28 loc) · 940 Bytes
/
TCP_main_client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from TCP_client import TCP_client
import time
import pandas as pd
tamanhos = [100, 500, 1000]
HEADER_SIZE = 66
for tamanho in tamanhos:
tempos = []
sizes = []
total_pacotes = []
for i in range(10):
time.sleep(1)
tempo, contador_pacotes = TCP_client(tamanho, HEADER_SIZE)
tempos.append(tempo)
sizes.append(tamanho)
total_pacotes.append(contador_pacotes)
print(f"Finished iteration {i} for size {tamanho}, {tempo} seg")
time.sleep(1)
results = pd.DataFrame({
'Tamanho': sizes,
'Tempos': tempos,
'Pacotes': total_pacotes
})
if tamanho==100:
results.to_csv("ResultadosTCPPCPETEthernet.csv",index=False)
else:
file_df = pd.read_csv("ResultadosTCPPCPETEthernet.csv")
file_df = pd.concat([file_df,results], ignore_index=True)
file_df.to_csv("ResultadosTCPPCPETEthernet.csv",index=False)