File: client_cpu_udp_socket.py

package info (click to toggle)
labplot 2.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 70,348 kB
  • sloc: cpp: 145,806; ansic: 4,534; python: 881; yacc: 540; xml: 357; sh: 185; awk: 35; makefile: 7
file content (15 lines) | stat: -rwxr-xr-x 241 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python

from socket import *
import psutil

HOST = 'localhost'
PORT = 1027
ADDR = (HOST,PORT)
client = socket(AF_INET, SOCK_DGRAM)
client.bind(ADDR)
while True:
  data, addr = client.recvfrom(1024)
  print('read ' + data, addr)