for tests
This commit is contained in:
15
for_testing_multicast/sender.py
Normal file
15
for_testing_multicast/sender.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from typing import Any, Tuple, Generator
|
||||
from ipaddress import IPv6Address
|
||||
import re
|
||||
import socket
|
||||
import time
|
||||
import struct
|
||||
|
||||
# Initialise socket for IPv6 datagrams
|
||||
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
|
||||
|
||||
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
|
||||
|
||||
sock.sendto("hello world".encode('utf-8'), ("ff02::4242:4242", 1212))
|
||||
|
||||
|
Reference in New Issue
Block a user