Im trying to create a script that will send a specific amount of packets with tcp/udp
i used the next script as a start to check how the socket module works and its working. but the massage is not at the size of 1 packet. can anyone help?
Client:
import socket
UDP_IP = "0.0.0.0" # = 0.0.0.0 u IPv4
UDP_PORT = 5005
MESSAGE = "Hello, World!"
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", MESSAGE
sock = socket.socket(socket.AF_INET, # Internet
socket.SOCK_DGRAM) # UDP
print "Socket is connected!", sock
for x in range(0,300):
print "send"
sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))