Skip to main content

A simple module for sending data across the internet!

Project description

ConnectIO

A simple module for sending data across the internet!

Use cases

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

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}')

        resp2 = 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()
    resp2 = client.send('hi server! how are you?')
    resp3 = client.send('great thanks!')

    client.close()


if __name__ == "__main__":
    main()

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

connectIO-0.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

connectIO-0.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file connectIO-0.0.1.tar.gz.

File metadata

  • Download URL: connectIO-0.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for connectIO-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dbcaa907ee9b29739d5f1c0ed071c8efa7caefac54f385b4d2cfa79cd422b93e
MD5 645f4fa387d033e86c565e0f6342155c
BLAKE2b-256 baed3b9fd883f4220c0c82dc19a326f7d62b7f8847a2fdf8cdea41c153938bc2

See more details on using hashes here.

File details

Details for the file connectIO-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: connectIO-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for connectIO-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f2bb10daf9c6d3a8345d163f09063a576b67fb7a91c43c15f15e0b3cca436df
MD5 e7f5fecf4db2a50f43dc48667a3c7936
BLAKE2b-256 c8bbb2c9a6449f1e20bb5a3eeb0539c2bf88d6b4c6625716ef1b12e90eace570

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