Skip to main content

SocketMan

  • 通过socket进行进程或python脚本间通信
  • 可传输python对象
  • 通过命名而非端口号管理和分配端口
  • 自动查找可用端口
  • 简单数据加密
  • 试验用途, 请勿在生产环境中使用

安装

pip install socketman

使用

  • 一个程序间通信的样例
# script_A

from socketman import autoConnect

def handle_recieve( eventparams ):
    print(eventparams)
    rconn.send({'reciverd':eventparams['obj']})

conn = autoConnect('端口a')
conn.autorecv(handle_recieve) # 自动接收消息
# script_B

from socketman import autoConnect

conn = autoConnect('端口a')
conn.send({'test':'obj'})
print(conn.recv())
conn.close()

进阶使用

import socketman
conn = autoConnect(pname='端口a', passwd='abcde', ptype=socketman.PType.p2p, host='localhost')

Release files for socketman 0.4.0

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

Source distribution (sdist)

Source distribution for socketman 0.4.0
File Size Uploaded
socketman-0.4.0.tar.gz 8.6 kB Details

Built distribution (wheel)

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

Total release size: 31.8 kB

Release files / socketman-0.4.0.tar.gz

Download URL socketman-0.4.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
151ffb8cb76dffaeb88716cd68c385e28de7db99c1e2538e4d481e827e5db227
BLAKE2b-256 checksum
How to use checksums
27a29a329b908b3f6b30f67631fdb15760ab67d4f3fb6b680fd236958a9540b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / socketman-0.4.0-py3-none-any.whl

Download URL socketman-0.4.0-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcd889dc6661c421d3772ddfd9b97a1e5b1d46fb3ee31debd485a54fdee7cb1c
BLAKE2b-256 checksum
How to use checksums
92b909f48136c0e242cb8e366ab3945aaed00ac2511107691a9fcb11640d1d9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.0

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