网络编程之udp_socket

# socket基本的步骤

import socket


class SC(object):

def f(self):
udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

udp_socket.sendto(b'hahahaha', ('192.168.7.11', 8080))

udp_socket.close()


if __name__ == '__main__':
sc = SC()
sc.f()
点赞