File: client_cpu_udp_socket.py

package info (click to toggle)
labplot 2.12.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 78,528 kB
  • sloc: cpp: 241,047; ansic: 6,324; python: 915; xml: 400; yacc: 237; sh: 221; awk: 35; makefile: 11
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)