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.26.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipcpy-2024.11.26-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ipcpy-2024.11.26.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/24.1.0

File hashes

Hashes for ipcpy-2024.11.26.tar.gz
Algorithm Hash digest
SHA256 82141869e2526101baea75f32aadc1b2fbe7831f2cde5fa822743a9a86c2b130
MD5 818984eaeb691f013b1f98859c615fd8
BLAKE2b-256 e0f4be280afd28aca382e0cb70b593bdd3230642289acb3d1a98724074ef431e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ipcpy-2024.11.26-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/24.1.0

File hashes

Hashes for ipcpy-2024.11.26-py3-none-any.whl
Algorithm Hash digest
SHA256 ac0afd1699190f3da88f14ad03afd7bb9bff214366bfad720e92873cde04b4da
MD5 34e37f85461851507d4faa10f41c4f9d
BLAKE2b-256 3146219b1a72a2b85db49c943be1bce1fc5c6a6b37e0d51a9fb7f93f6708a15e

See more details on using hashes here.

Supported by

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