Skip to main content

A library based on asyncore, used to build tcp server/client application communicating each other with customized messages.

Examples

Server:

import asynmsg

@asynmsg.with_message_handler_config
class ServerSession(asynmsg.SessionS):

    @asynmsg.message_handler_config('Login')
    def on_Login(self, msg_id, msg_data):
        self.send_message('LoginAck', 'login success')

class Server(asynmsg.Server):
    session_class = ServerSession

Server(('127.0.0.1', 12345))
asynmsg.run_forever()

Client:

import asynmsg

@asynmsg.with_message_handler_config
class ClientSession(asynmsg.SessionC):
    def on_opened(self):
        asynmsg.SessionC.on_opened(self)
        self.send_message('Login', 'test1')

    @asynmsg.message_handler_config('LoginAck')
    def on_LoginAck(self, msg_id, msg_data):
        pass

class Client(asynmsg.ClientBlockConnect):
    session_class = ClientSession

client = Client(('127.0.0.1', 12345))
if client.is_started():
    asynmsg.run_forever()

Download files

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

Source Distribution

asynmsg-0.1.6.zip (11.4 kB view details)

Uploaded Source

File details

Details for the file asynmsg-0.1.6.zip.

File metadata

  • Download URL: asynmsg-0.1.6.zip
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for asynmsg-0.1.6.zip
Algorithm Hash digest
SHA256 13f8ed4ec5b653430e536b9c65045fff990ee5592d443ec043ce657fed253b64
MD5 6f1399ce10cc994394b8709adaa418ad
BLAKE2b-256 a92bd8b62609946f7c629285d3ed4185a05e1ef40afcf91aa0fba630bf2384c7

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.4

1 file

0.2.3

1 file

0.2.2

2 files

0.2.1

1 file

0.2.0

1 file

0.1.15

1 file

0.1.14

1 file

0.1.13

1 file

0.1.12

1 file

0.1.11

1 file

0.1.10

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

This release

0.1.6 This release

1 file

0.1.5

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page