Skip to main content

KoriNet (Korixa Network Protocol) - A lightweight, secure TCP protocol for structured high-level data exchange.

Project description

KoriNet (Korixa Network Protocol)

A modern alternative for TCP communication—simple, fast, and secure. Designed to structure high-level data exchanges, KoriNet ensures reliability, integrity, and continuity. Lightweight and modular, it adapts to any type of application, from chat and audio to server management, providing developers with a robust and universal protocol.

⚠️ Warning / Usage Limitations

KoriNet is not recommended for public production use. Its current design, which ACKs every message, is optimized for low-latency LANs and stable 24/7 infrastructures. It is intended for internal APIs and fixed applications, not for video, high-latency networks, or heterogeneous clients.

⚠️ Important: At the moment, there is no version coordination, so all clients must run the exact same version of KoriNet to ensure reliability. Future updates will add TLS 1.3 encryption and version management.

Use KoriNet only in environments where stability, low latency, and controlled network conditions are guaranteed.

🔌 Connection resilience & reconnection handling

Terminal Screenshot

The following console capture illustrates how KoriNet behaves during a connection loss between a client and a server.

(1) Client-side behavior

The client automatically detects the connection failure and continuously attempts to reconnect by creating new TCP sockets. This demonstrates KoriNet’s ability to recover from transient network errors without manual intervention.

(2) Connection interruption

The disconnection is intentionally triggered using a KeyboardInterrupt on the server side. This simulates a real-world network failure (service crash, link loss, or network interruption) and produces the same behavior as an actual outage.

This example highlights KoriNet’s usefulness for long-running services (24/7), internal APIs, and stable infrastructures, where automatic reconnection and communication continuity are critical.

Example (0.0.1a1.dev1)

For the latest examples, please refer to: here, server, client.

☁️ Server

import time
import traceback
from korinet import server

# SOCKET
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(("127.0.0.1", 1235))
sock.listen(10)
sock.settimeout(5)
try:
    while True:
        try:
            conn, addr = sock.accept()
            client = server(conn)
            while True:
                print(client.recv(giveID=True))
                client.send({"status": True})
                time.sleep(1)
        except Exception as e:
            print(traceback.format_exc())
            print(e)
except Exception as e:
    print(traceback.format_exc())
    print(e)

👤 Client

from korinet import client
C = client("127.0.0.1", 1235, timeout=4)
num = 0
while True:
    C.send({"type": "ping", "num": num})
    print(C.recv())
    num += 1
    time.sleep(1)

🔧 RAW Protocol (Low-level usage)

from korinet import protocol

session = protocol.v2(sock)  # raw TCP socket required
session.send({"type": "ping"})

response = session.recv()
if response["status"] is not True:
    raise RuntimeError("Invalid response")

KoriNet exposes a raw protocol layer (protocol.v2) that can be used directly on top of an existing TCP socket, without the high-level client / server abstractions.

This mode is intended for advanced users who want:

  • full control over the socket lifecycle
  • minimal overhead
  • a simple framed message protocol (block-based send/recv)

⚠️ Important limitations

When using the RAW protocol:

  • No automatic reconnection
  • No session continuity
  • No metadata for recovery
  • No compatibility with client / server

If the underlying TCP socket is closed or lost, the session is definitively broken. You are fully responsible for:

  • detecting disconnections
  • recreating sockets
  • restoring application state

This behavior is equivalent to a classic TCP protocol without resilience.


🔌 When should you use RAW protocol?

Use protocol.v2 only if:

  • you do not need reconnection
  • your application tolerates socket loss
  • you want a thin, structured framing layer on top of TCP
  • you manage network failures yourself

Typical use cases:

  • short-lived connections
  • internal tools
  • experimental protocols
  • controlled environments

If you need 24/7 stability, automatic reconnection, or network fault tolerance, use the high-level client / server API instead.


➡️ In this mode, KoriNet only guarantees message framing, not connection recovery.


🧠 Design note

The RAW protocol is the foundation layer used internally by:

  • client
  • server

Those high-level components add:

  • reconnection logic
  • session metadata
  • continuity guarantees

Using protocol.v2 bypasses all of this by design.

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

korinet-0.0.1a1.dev1.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

korinet-0.0.1a1.dev1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file korinet-0.0.1a1.dev1.tar.gz.

File metadata

  • Download URL: korinet-0.0.1a1.dev1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for korinet-0.0.1a1.dev1.tar.gz
Algorithm Hash digest
SHA256 382a10be716c5b3083a179e259f41f3eb41b4b99353bbaa75bd2e956c0db7b4d
MD5 f914f37bb7cf70a89059da40ed4b11b1
BLAKE2b-256 ff0fbb9d2a3238aa7934c340c32bfdae9174a87d9dab85978ec877af04421ca5

See more details on using hashes here.

File details

Details for the file korinet-0.0.1a1.dev1-py3-none-any.whl.

File metadata

  • Download URL: korinet-0.0.1a1.dev1-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for korinet-0.0.1a1.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 2214a179232d6d4f1ee0ca13cf62652c1d78aac1b454cfc1443c7d869b258f88
MD5 ea80e62f66d66ab6302a47ac8ae48bdd
BLAKE2b-256 2219c8229fff5c7b93c172d7b5fc04fa60569090fc6117482c6abdbcd51dd99e

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