Markdown Format | JSON API | MCP Server Tool
Help on module asyncore: NAME asyncore - Basic infrastructure for asynchronous socket service clients and servers. MODULE REFERENCE https://docs.python.org/3.10/library/asyncore.html The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above. DESCRIPTION There are only two ways to have a program on a single processor do "more than one thing at a time". Multi-threaded programming is the simplest and most popular way to do it, but there is another very different technique, that lets you have nearly all the advantages of multi-threading, without actually using multiple threads. it's really only practical if your program is largely I/O bound. If your program is CPU bound, then pre-emptive scheduled threads are probably what you really need. Network servers are rarely CPU-bound, however. If your operating system supports the select() system call in its I/O library (and nearly all do), then you can use it to juggle multiple communication channels at once; doing other work while your I/O is taking place in the "background." Although this strategy can seem strange and complex, especially at first, it is in many ways easier to understand and control than multi-threaded programming. The module documented here solves many of the difficult problems for you, making the task of building sophisticated high-performance network servers and clients a snap. CLASSES builtins.Exception(builtins.BaseException) ExitNow builtins.object dispatcher dispatcher_with_send file_dispatcher file_wrapper class ExitNow(builtins.Exception) | Method resolution order: | ExitNow | builtins.Exception | builtins.BaseException | builtins.object | | Data descriptors defined here: | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Methods inherited from builtins.Exception: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | ---------------------------------------------------------------------- | Static methods inherited from builtins.Exception: | | __new__(*args, **kwargs) from builtins.type | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Methods inherited from builtins.BaseException: | | __delattr__(self, name, /) | Implement delattr(self, name). | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Helper for pickle. | | __repr__(self, /) | Return repr(self). | | __setattr__(self, name, value, /) | Implement setattr(self, name, value). | | __setstate__(...) | | __str__(self, /) | Return str(self). | | with_traceback(...) | Exception.with_traceback(tb) -- | set self.__traceback__ to tb and return self. | | ---------------------------------------------------------------------- | Data descriptors inherited from builtins.BaseException: | | __cause__ | exception cause | | __context__ | exception context | | __dict__ | | __suppress_context__ | | __traceback__ | | args class dispatcher(builtins.object) | dispatcher(sock=None, map=None) | | Methods defined here: | | __init__(self, sock=None, map=None) | Initialize self. See help(type(self)) for accurate signature. | | __repr__(self) | Return repr(self). | | accept(self) | | add_channel(self, map=None) | | bind(self, addr) | | close(self) | | connect(self, address) | | create_socket(self, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>) | | del_channel(self, map=None) | | handle_accept(self) | | handle_accepted(self, sock, addr) | | handle_close(self) | | handle_connect(self) | | handle_connect_event(self) | | handle_error(self) | | handle_expt(self) | | handle_expt_event(self) | | handle_read(self) | | handle_read_event(self) | | handle_write(self) | | handle_write_event(self) | | listen(self, num) | | log(self, message) | | log_info(self, message, type='info') | | readable(self) | | recv(self, buffer_size) | | send(self, data) | | set_reuse_addr(self) | | set_socket(self, sock, map=None) | | writable(self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | accepting = False | | addr = None | | closing = False | | connected = False | | connecting = False | | debug = False | | ignore_log_types = frozenset({'warning'}) class dispatcher_with_send(dispatcher) | dispatcher_with_send(sock=None, map=None) | | Method resolution order: | dispatcher_with_send | dispatcher | builtins.object | | Methods defined here: | | __init__(self, sock=None, map=None) | Initialize self. See help(type(self)) for accurate signature. | | handle_write(self) | | initiate_send(self) | | send(self, data) | | writable(self) | | ---------------------------------------------------------------------- | Methods inherited from dispatcher: | | __repr__(self) | Return repr(self). | | accept(self) | | add_channel(self, map=None) | | bind(self, addr) | | close(self) | | connect(self, address) | | create_socket(self, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>) | | del_channel(self, map=None) | | handle_accept(self) | | handle_accepted(self, sock, addr) | | handle_close(self) | | handle_connect(self) | | handle_connect_event(self) | | handle_error(self) | | handle_expt(self) | | handle_expt_event(self) | | handle_read(self) | | handle_read_event(self) | | handle_write_event(self) | | listen(self, num) | | log(self, message) | | log_info(self, message, type='info') | | readable(self) | | recv(self, buffer_size) | | set_reuse_addr(self) | | set_socket(self, sock, map=None) | | ---------------------------------------------------------------------- | Data descriptors inherited from dispatcher: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Data and other attributes inherited from dispatcher: | | accepting = False | | addr = None | | closing = False | | connected = False | | connecting = False | | debug = False | | ignore_log_types = frozenset({'warning'}) class file_dispatcher(dispatcher) | file_dispatcher(fd, map=None) | | Method resolution order: | file_dispatcher | dispatcher | builtins.object | | Methods defined here: | | __init__(self, fd, map=None) | Initialize self. See help(type(self)) for accurate signature. | | set_file(self, fd) | | ---------------------------------------------------------------------- | Methods inherited from dispatcher: | | __repr__(self) | Return repr(self). | | accept(self) | | add_channel(self, map=None) | | bind(self, addr) | | close(self) | | connect(self, address) | | create_socket(self, family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>) | | del_channel(self, map=None) | | handle_accept(self) | | handle_accepted(self, sock, addr) | | handle_close(self) | | handle_connect(self) | | handle_connect_event(self) | | handle_error(self) | | handle_expt(self) | | handle_expt_event(self) | | handle_read(self) | | handle_read_event(self) | | handle_write(self) | | handle_write_event(self) | | listen(self, num) | | log(self, message) | | log_info(self, message, type='info') | | readable(self) | | recv(self, buffer_size) | | send(self, data) | | set_reuse_addr(self) | | set_socket(self, sock, map=None) | | writable(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from dispatcher: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) | | ---------------------------------------------------------------------- | Data and other attributes inherited from dispatcher: | | accepting = False | | addr = None | | closing = False | | connected = False | | connecting = False | | debug = False | | ignore_log_types = frozenset({'warning'}) class file_wrapper(builtins.object) | file_wrapper(fd) | | Methods defined here: | | __del__(self) | | __init__(self, fd) | Initialize self. See help(type(self)) for accurate signature. | | close(self) | | fileno(self) | | getsockopt(self, level, optname, buflen=None) | | read = recv(self, *args) | | recv(self, *args) | | send(self, *args) | | write = send(self, *args) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) FUNCTIONS close_all(map=None, ignore_all=False) compact_traceback() loop(timeout=30.0, use_poll=False, map=None, count=None) poll(timeout=0.0, map=None) poll2(timeout=0.0, map=None) poll3 = poll2(timeout=0.0, map=None) read(obj) readwrite(obj, flags) write(obj) DATA EAGAIN = 11 EALREADY = 114 EBADF = 9 ECONNABORTED = 103 ECONNRESET = 104 EINPROGRESS = 115 EINVAL = 22 EISCONN = 106 ENOTCONN = 107 EPIPE = 32 ESHUTDOWN = 108 EWOULDBLOCK = 11 errorcode = {1: 'EPERM', 2: 'ENOENT', 3: 'ESRCH', 4: 'EINTR', 5: 'EIO'... socket_map = {} FILE /usr/lib/python3.10/asyncore.py
Generated by phpMan Author: Che Dong Under GNU General Public License
2026-06-02 05:14 @216.73.216.198 CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)