Skip to content
Snippets Groups Projects
Commit cefd5891 authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

fix bug

parent d2c71bcc
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ f = 0
A = []
p_NAT = 0
P_values = []
MAX_TOTAL_TRAFFIC = 5000 # Pkts/s
MAX_TOTAL_TRAFFIC = 5000 # Pkts/s
PROTO = "UDP"
TIME_GENERATE = 3600000 # ms
......@@ -80,16 +80,21 @@ def generate_and_send_traffic_matrix():
print("IP:", ip, " should received rate:", receive_rate)
def connect_attackers(ip):
c_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
c_socket.connect((ip, 12345))
c_socket.close()
except Exception:
pass
def notify_window_attacker():
global map_point
point_ips = map_point.keys()
for point_ip_send in point_ips:
c_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
c_socket.connect((point_ip_send, 12345))
c_socket.close()
except Exception:
pass
threading.Thread(target=connect_attackers, args=[point_ip_send]).start()
print("Finished sending attack demands")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment