Skip to main content

TarCo Communication (tarcom)

TcpClient

Communicate with network devices as TCP client.

TcpServer

Create a TCP server to communicate with network devices.

   

Usage

from tarcom import TcpServer, TcpClient

print("Started")

isServer = True

address = "192.168.0.1"
port = 42424

if isServer:
    com = TcpServer(port)
else:
    com = TcpClient(address, port)


def connectionUpdatedEventHandler(sender, args):
    if(args.connected):
        print(args.address + ": " + "Connected")
    else:
        print(args.address + ": " + "Disconnected")


def dataReceivedEventHandler(sender, args):
    print(args.address + ": " + args.data)


com.connectionUpdated = connectionUpdatedEventHandler
com.dataReceived = dataReceivedEventHandler
com.connect()

inputStr = None
while inputStr != "E":
    inputStr = input("Input (E = Exit):\n")
    if inputStr != None:
        com.send(inputStr)

print("Stopped")

   

Internal Use Only (Use at your own risk)

Download files

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

Source Distribution

tarcom-0.1.5.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file tarcom-0.1.5.tar.gz.

File metadata

  • Download URL: tarcom-0.1.5.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.8

File hashes

Hashes for tarcom-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a52890197a300c453828f65e8472877c2cafe24e3d04e76b966969a0e404f999
MD5 413b01714b7ba6627830fcfce24b5c4d
BLAKE2b-256 a2f74cf3a700215155778c138e796f62897638c1885480b4f871ec9bf3dd2972

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.5 This release

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

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