# Path: stator/lib.py



import sys
import logging
from io import BytesIO
from ctypes import CFUNCTYPE, POINTER, c_uint64, c_char, c_size_t, c_uint8
from ctypes import py_object, c_void_p, c_int
from .lib import dll
        self._sockets.pop(id, None)


TABLE = SocketTable()

@_message_parser
def parse_message(sock_id, buf, buf_len):
    try:
        sock = TABLE.get(sock_id)
        if sock is None:
            log.debug("Got message for socket {} which is already closed",
                sock_id)
            return None
        buf = BytesIO((c_uint8 * buf_len).from_address(buf))
        return sock.parse_message(buf)
    except BaseException as e:
        return e


@_skip
def no_message():
    return None

@_skip
def blocking_io():
    return False


def events():
    while True:

# Path: stator/lib.py



# Path: stator/loop.py
import sys
import logging
from io import BytesIO
from ctypes import CFUNCTYPE, POINTER, c_uint64, c_char, c_size_t, c_uint8
from ctypes import py_object, c_void_p, c_int
from .lib import dll

        self._sockets.pop(id, None)


TABLE = SocketTable()

@_message_parser
def parse_message(sock_id, buf, buf_len):
    try:
        sock = TABLE.get(sock_id)
        if sock is None:
            log.debug("Got message for socket {} which is already closed",
                sock_id)
            return None
        buf = BytesIO((c_uint8 * buf_len).from_address(buf))
        return sock.parse_message(buf)
    except BaseException as e:
        return e


@_skip
def no_message():
    return None

@_skip
def blocking_io():
    return False


def events():
    while True:

        message = dll.stator_wait_message(parse_message, no_message)