Curso-lenguaje-python/python-ofensivo/07_conexiones_red_protocolos/03_socket/client.py

19 lines
327 B
Python

#!/usr/bin/env python3
import socket
def start_udp_client():
host = 'localhost'
port = 1234
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
msg = 'Hola Servidor UDP! Se está tensando para pasar tildes'.encode(
'utf-8')
s.sendto(msg, (host, port))
start_udp_client()