Skip to main content

A interprocess communications (IPC) framework using UDP

Project description

Inter-Process Communications (IPC)

GitHub Latest Version image image PyPI - Downloads

A simple library to allow processes to use UDP to communicate with each other.

This is yet again another rehash of old work in a new way ... I keep reinventing the wheel. :)

in development

Example

import ipcpy as ipc
from collections import namedtuple

Msg = namedtuple("Msg","a b c")

d = {
    22: ("i", int),
    23: ("iii", Msg),
}

msglib = MsgLibrary(d)
run = True

def client():
    global run
    print("Client started")
    s = ipc.SocketUDP()
    s.open(TIMEOUT)

    for i in range(10):
        pkt = msglib.pack(MSG_ID_INT, [i])
        print(f"send: {pkt}")
        s.sendto(pkt, (HOST,PORT))
        time.sleep(0.25)
        # print('.')

    run = False

def server():
    global run
    print("Client started")
    s = ipc.SocketUDP()
    s.bind(HOST,PORT,TIMEOUT)

    while run:
        data, address = s.recvfrom(MSG_SIZE)
        if data is not None:
            id, info = ipc.get_msg(data)
            if id is not None:
                msg = msglib.unpack(id, info)
                print(f"recvfrom: {address} {info} {msg}")
            else:
                print(f"ERROR: {info}")

MIT License

Copyright (c) 2003 Kevin J. Walchko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipcpy-2024.11.10.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

ipcpy-2024.11.10.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file ipcpy-2024.11.10.2.tar.gz.

File metadata

  • Download URL: ipcpy-2024.11.10.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/21.6.0

File hashes

Hashes for ipcpy-2024.11.10.2.tar.gz
Algorithm Hash digest
SHA256 1deb573ab114a88340ee21fd6b00448f1e06b73f77629b2eaa0acf78734174d2
MD5 7d6f5ef4534e96689a8e030d222319c8
BLAKE2b-256 f235ed7b145053699399fb1e4639b4b47fd75d255440923e5ec35d4d320e5923

See more details on using hashes here.

File details

Details for the file ipcpy-2024.11.10.2-py3-none-any.whl.

File metadata

  • Download URL: ipcpy-2024.11.10.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/21.6.0

File hashes

Hashes for ipcpy-2024.11.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7b0fa8dc4bc91801df4cc7ba97dc2ced79dd1329d833e13c6adae49c16ba9048
MD5 661ca51c3de3e72574a15d88c38e2453
BLAKE2b-256 f98e5ffae3ad025b62c22a4dfed304a8967fa8a21b9ddd68410ba018528da261

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page