tjguk / networkzero

Making it easy for teachers to use simple networking in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NetworkZero

image

Make it easy for learning groups to use simple networking in Python

API

address below refers to an IP:Port string eg "192.0.2.5:4567"

Discovery

  • address = advertise(name, address=None)
  • address = discover(name, wait_for_s=FOREVER)
  • [(name, address), ...] = discover_all()
  • [(name, address), ...] = discover_group(group_name, separator="/")

Messaging

  • reply = send_message_to(address, message, wait_for_reply_s=FOREVER)
  • message = wait_for_message_from(address, [wait_for_s=FOREVER])
  • send_reply_to(address, reply)
  • send_news_to(address, news)
  • wait_for_news_from(address[, pattern=EVERYTHING][, wait_for_s=FOREVER])

Typical Usage

On computer (or process) A:

On computer (or process) B and C and D...:

About

Making it easy for teachers to use simple networking in Python

License:MIT License


Languages

Language:Python 95.1%Language:Shell 2.4%Language:C 2.4%Language:Batchfile 0.1%