All Projects → jczic → XAsyncSockets

jczic / XAsyncSockets

Licence: MIT license
XAsyncSockets is an efficient Python/MicroPython library of managed asynchronous sockets.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to XAsyncSockets

Message Io
Event-driven message library for building network applications easy and fast.
Stars: ✭ 321 (+1046.43%)
Mutual labels:  tcp, sockets, asynchronous, udp
Swiddler
TCP/UDP debugging tool.
Stars: ✭ 56 (+100%)
Mutual labels:  tls, ssl, tcp, udp
SimpleSockets
Asynchronous TCP .NET library with reliable transmission and receipt of data, with an ssl implementation.
Stars: ✭ 74 (+164.29%)
Mutual labels:  tls, ssl, client-server
Beast
HTTP and WebSocket built on Boost.Asio in C++11
Stars: ✭ 3,241 (+11475%)
Mutual labels:  tls, ssl, async-programming
Leaf
A lightweight and fast proxy utility tries to include any useful features.
Stars: ✭ 530 (+1792.86%)
Mutual labels:  tls, tcp, udp
boost-wintls
Native Windows TLS stream wrapper for use with boost::asio
Stars: ✭ 24 (-14.29%)
Mutual labels:  tls, ssl, async-programming
riemannx
A riemann client for elixir (TCP/UDP/TLS supported)
Stars: ✭ 23 (-17.86%)
Mutual labels:  tls, tcp, udp
safeminer
全网第一款本地连接矿池加密软件,隐藏本地ip、加密数据包、流量混淆,可实现防止被监管的目的
Stars: ✭ 8 (-71.43%)
Mutual labels:  tls, ssl, pool
Packetsender
Network utility for sending / receiving TCP, UDP, SSL
Stars: ✭ 1,349 (+4717.86%)
Mutual labels:  ssl, tcp, udp
React Native Tcp Socket
React Native TCP socket API for Android, iOS & macOS with client SSL/TLS support
Stars: ✭ 112 (+300%)
Mutual labels:  tls, ssl, tcp
Beetlex
high performance dotnet core socket tcp communication components, support TLS, HTTP, HTTPS, WebSocket, RPC, Redis protocols, custom protocols and 1M connections problem solution
Stars: ✭ 802 (+2764.29%)
Mutual labels:  tls, ssl, tcp
Goproxy
🔥 Proxy is a high performance HTTP(S) proxies, SOCKS5 proxies,WEBSOCKET, TCP, UDP proxy server implemented by golang. Now, it supports chain-style proxies,nat forwarding in different lan,TCP/UDP port forwarding, SSH forwarding.Proxy是golang实现的高性能http,https,websocket,tcp,socks5代理服务器,支持内网穿透,链式代理,通讯加密,智能HTTP,SOCKS5代理,黑白名单,限速,限流量,限连接数,跨平台,KCP支持,认证API。
Stars: ✭ 11,334 (+40378.57%)
Mutual labels:  tls, tcp, udp
Asio2
Header only c++ network library, based on asio,support tcp,udp,http,websocket,rpc,ssl,icmp,serial_port.
Stars: ✭ 202 (+621.43%)
Mutual labels:  ssl, tcp, udp
Firefly
Firefly is an asynchronous web framework for rapid development of high-performance web application.
Stars: ✭ 277 (+889.29%)
Mutual labels:  tls, tcp, asynchronous
Shackle
High-Performance Erlang Network Client Framework
Stars: ✭ 163 (+482.14%)
Mutual labels:  ssl, tcp, udp
Cnp3
Computer Networking : Principles, Protocols and Practice (first and second edition, third edition is being written on https://github.com/cnp3/ebook)
Stars: ✭ 471 (+1582.14%)
Mutual labels:  tls, tcp, udp
aioudp
Asyncio UDP server
Stars: ✭ 21 (-25%)
Mutual labels:  asynchronous, udp, async-programming
Gensio
A library to abstract stream I/O like serial port, TCP, telnet, UDP, SSL, IPMI SOL, etc.
Stars: ✭ 30 (+7.14%)
Mutual labels:  ssl, tcp, udp
Easytcp
Simple framework for TCP clients and servers. Focused on performance and usability.
Stars: ✭ 60 (+114.29%)
Mutual labels:  ssl, tcp, sockets
Blinksocks
A framework for building composable proxy protocol stack.
Stars: ✭ 587 (+1996.43%)
Mutual labels:  tls, tcp, udp

XAsyncSockets is an efficient Python/MicroPython library of managed asynchronous sockets.

HC²

Very easy to integrate and very light with one file only :

  • "XAsyncSockets.py"

XAsyncSockets features :

  • Managed asynchronous sockets in a pool (up to thousands!)
  • Works directly with I/O to receive and send very quickly
  • Supports very large number of simultaneous TCP connections
  • Supports concurrent synchronous processing operations if necessary (threaded)
  • Implementation of TCP servers
  • Implementation of TCP clients
  • Implementation of UDP datagrams (sender and/or receiver)
  • TCP client can event after a specified size of data or a text line received
  • Each connections and receivings can waiting during a specified time
  • The reasons of TCP client closures are returned
  • Really robust, very fast and easy to use
  • Compatible with MicroPython implementation (sockets layer, FiFo queue, perf counter)

XAsyncSockets classes :

Class name Description
XAsyncSocketsPool Managed pool of 'XAsyncSocket' objects
XClosedReason Enumerator of 'XAsyncSocket' closing reasons
XAsyncSocket Abstract class of managed asynchronous sockets
XAsyncTCPServer TCP server implementation of 'XAsyncSocket'
XAsyncTCPClient TCP client implementation of 'XAsyncSocket'
XAsyncUDPDatagram UDP sender/recever implementation of 'XAsyncSocket'
XBufferSlot Managed buffer
XBufferSlots Managed buffers collection
XFiFo Dedicated FiFo queue

XAsyncSockets exceptions :

Class name Description
XAsyncSocketsPoolException Exception class for 'XAsyncSocketsPool'
XAsyncSocketException Exception class for 'XAsyncSocket'
XAsyncTCPServerException Exception class for 'XAsyncTCPServer'
XAsyncTCPClientException Exception class for 'XAsyncTCPClient'
XAsyncUDPDatagramException Exception class for 'XAsyncUDPDatagram'
XFiFoException Exception class for 'XFiFo'

XAsyncSocketsPool class details :

Method Arguments
Constructor None
GetAllAsyncSockets None
GetAsyncSocketByID id (int)
AsyncWaitEvents threadsCount=0 (int)
StopWaitEvents None
Property Details
WaitEventsProcessing Return True if "WaitEvents" is in processing

( Do not call directly the methods AddAsyncSocket, RemoveAsyncSocket, NotifyNextReadyForReading and NotifyNextReadyForWriting )

XClosedReason class details :

Static variable Value
Error 0x00
ClosedByHost 0x01
ClosedByPeer 0x02
Timeout 0x03

XAsyncSocket class details :

Method Arguments
GetAsyncSocketsPool None
GetSocketObj None
Close None
Property Details
SocketID Get the opened socket unique ID
OnClosed Get or set an event of type f(closedReason)
State Get or set a custom object

XAsyncTCPServer class details :

Method Arguments
Create (static) asyncSocketsPool, srvAddr (tuple of ip and port), srvBacklog=256 (int), bufSlots=None
Property Details
SrvAddr Tuple of ip and port
OnClientAccepted Get or set an event of type f(xAsyncTCPServer, xAsyncTCPClient)

XAsyncTCPClient class details :

Method Arguments
Create (static) asyncSocketsPool, srvAddr (tuple of ip and port), connectTimeout=5 (int), recvBufLen=4096 (int), sendBufLen=4096(int), connectAsync=True (bool)
AsyncRecvLine lineEncoding='UTF-8', onLineRecv=None (function), onLineRecvArg=None (object), timeoutSec=None (int)
AsyncRecvData size=None (int), onDataRecv=None (function), onDataRecvArg=None (object), timeoutSec=None (int)
AsyncSendData data (bytes or buffer protocol), onDataSent=None (function), onDataSentArg=None (object)
AsyncSendSendingBuffer size=None (int), onDataSent=None (function), onDataSentArg=None (object)
StartSSL keyfile=None, certfile=None, server_side=False, cert_reqs=ssl.CERT_NONE, ca_certs=None
StartSSLContext sslContext, serverSide=False
  • onLineRecv is a callback event of type f(xAsyncTCPClient, line, arg)
  • onDataRecv is a callback event of type f(xAsyncTCPClient, data, arg)
  • onDataSent is a callback event of type f(xAsyncTCPClient, arg)
  • StartSSL and StartSSLContext doesn't works on MicroPython (in asynchronous non-blocking sockets mode)
  • It is widely recommended to use StartSSLContext rather than StartSSL (old version)
Property Details
SrvAddr Tuple of ip and port
CliAddr Tuple of ip and port
IsSSL Return True if SSL is used
SendingBuffer Get the existing buffer (memoryview) used to send data
OnFailsToConnect Get or set an event of type f(xAsyncTCPClient)
OnConnected Get or set an event of type f(xAsyncTCPClient)

XAsyncUDPDatagram class details :

Method Arguments
Create (static) asyncSocketsPool, localAddr=None (tuple of ip and port), recvBufLen=4096 (int), broadcast=False (bool)
AsyncSendDatagram datagram (bytes or buffer protocol), remoteAddr (tuple of ip and port), onDataSent=None (function), onDataSentArg=None (object)
  • onDataSent is a callback event of type f(xAsyncUDPDatagram, arg)
Property Details
LocalAddr Tuple of ip and port
OnRecv Get or set an event of type f(xAsyncUDPDatagram, remoteAddr, datagram)
OnFailsToSend Get or set an event of type f(xAsyncUDPDatagram, datagram, remoteAddr)

XBufferSlot class details :

Method Arguments
Constructor size (int), keepAlloc=True (bool)
Property Details
Available Get or set the availability of the slot
Size Get the buffer size of the slot
Buffer Get the buffer of the slot

XBufferSlots class details :

Method Arguments
Constructor slotsCount (int), slotsSize (int), keepAlloc=True (bool)
GetAvailableSlot None
Property Details
SlotsCount Get the number of slots
SlotsSize Get the buffer size of each slots
Slots Get the list of slots

XFiFo class details :

Method Arguments
Constructor None
Put obj (object)
Get None
Clear None
Property Details
Empty Return True if the FiFo is empty

By JC`zic for HC² ;')

Keep it simple, stupid 👍

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].