This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import select | |
import time | |
from concurrent import futures | |
def udp_request(src_ip,src_port,dst_ip,dst_port): | |
'''send an UDP packet that contain a string of "hello" to the dst_ip:dst_port from src_ip:src_port''' | |
# create the request socket | |
request_socket = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) | |
request_socket.bind((src_ip,src_port)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import select | |
if __name__ == "__main__": | |
# constant of program | |
IP_ADDRESS = "192.168.11.10" | |
PORT_NO_START = 10024 | |
PORT_NO_END = 10124 | |
# the payload that UDP server will response |