Skip to main content

ConnectIO

A simple module for sending data across the internet!

Use cases

  • Multiplayer pygame games (sending objects)
  • Chat server with multiple clients
  • Transferring files over a network
  • Anything else you can think of!

Installation

pip install connectIO

Simple Example

Server

from connectIO import Server, threaded

class ExampleServer(Server):

    def __init__(self, ip='127.0.0.1', port=5555):
        super(ExampleServer, self).__init__(ip, port)
        self.func = self.threaded_conn

    @threaded
    def threaded_conn(self, conn, addr):
        raddr = conn.getpeername()

        greeting = 'hello client!'
        print(f'Server -> {raddr}: {greeting}')

        self.send(conn, greeting)
        print(f'{raddr} -> Server: {self.recieve(conn)}')

        response = 'great you?'
        print(f'Server -> {raddr}: {response}')

        self.send(conn, response)
        print(f'{raddr} -> Server: {self.recieve(conn)}')


if __name__ == "__main__":
    ExampleServer().run()

Client

from connectIO import Client

def main():
    client = Client()
    client.connect()

    resp1 = client.recieve()
    print(f'From server: {resp1}')

    msg1 = 'hi server! how are you?'
    client.send(msg1)
    print(f'To server: {msg1}')

    resp2 = client.recieve()
    print(f'From server: {resp2}')

    msg2 = 'great thanks!'
    client.send(msg2)
    print(f'To server: {msg2}')

    client.close()

if __name__ == "__main__":
    main()

Metadata

Release files for connectIO 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for connectIO 0.0.3
File Size Uploaded
connectIO-0.0.3.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for connectIO 0.0.3
File Interpreter ABI Platform
connectIO-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / connectIO-0.0.3.tar.gz

Download URL connectIO-0.0.3.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4bc9a659fc637358cbd1a58e3c3f007d4973af8633ba5c641f5e2b8ec7ac6e3a
BLAKE2b-256 checksum
How to use checksums
6dd456780604f17ba873f4590bb1056630d4f313c02b234e74ce1c68de8a89ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.3

Release files / connectIO-0.0.3-py3-none-any.whl

Download URL connectIO-0.0.3-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bf0b26bca7ed0c903c81e7f584b92f86e08e82a3588c8cb85239e406eb93c89
BLAKE2b-256 checksum
How to use checksums
b1a4f1b7bca7330924d5040adf1df662729b55a61daaca1f92ad49c8f897a690
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page