def fatuv_udp_recv_callback(handle, nread, buf, sockaddr, flags): ptr = uv_get_pyobj(handle) obj = ffi.from_handle(ptr) if nread < 0: obj._call_udp_recv_callback(None, nread, sockaddr, flags) elif nread > 0: data = ffi.unpack(buf.base, nread) obj._call_udp_recv_callback(data, nread, sockaddr, flags) else: obj._call_udp_recv_callback(None, nread, sockaddr, flags)
def fatuv_read_callback(stream_handle, nread, buf): ptr = uv_get_pyobj(stream_handle) obj = ffi.from_handle(ptr) if nread < 0: obj._call_read_callback(None, nread) elif nread > 0: data = ffi.unpack(buf.base, nread) obj._call_read_callback(data, nread) else: obj._call_read_callback(None, nread)
def fatuv_close_callback(handle): ptr = uv_get_pyobj(handle) obj = ffi.from_handle(ptr) obj._call_close_callback()
def fatuv_signal_callback(signal_handle, signum): ptr = uv_get_pyobj(signal_handle) obj = ffi.from_handle(ptr) obj._call_signal_callback(signum)
def fatuv_close_callback(handle): ptr = uv_get_pyobj(handle) # print('fatuv_close_callback') obj = ffi.from_handle(ptr) # print('fatuv_close_callback2') obj._call_close_callback()
def fatuv_async_callback(async_handle): ptr = uv_get_pyobj(async_handle) obj = ffi.from_handle(ptr) obj._call_async_callback()
def fatuv_poll_callback(poll_handle, status, events): ptr = uv_get_pyobj(poll_handle) obj = ffi.from_handle(ptr) obj._call_poll_callback(status, events)
def fatuv_write_callback(stream_handle, status): ptr = uv_get_pyobj(stream_handle) obj = ffi.from_handle(ptr) obj._call_write_callback(status)
def fatuv_fs_poll_callback(fs_poll_handle, status, uv_previous_stat, uv_current_stat): ptr = uv_get_pyobj(fs_poll_handle) obj = ffi.from_handle(ptr) obj._call_fs_poll_callback(status, uv_previous_stat, uv_current_stat)
def fatuv_connection_callback(stream_handle, status): ptr = uv_get_pyobj(stream_handle) obj = ffi.from_handle(ptr) obj._call_conn_callback(status)
def fatuv_udp_send_callback(handle, status): ptr = uv_get_pyobj(handle) obj = ffi.from_handle(ptr) obj._call_udp_send_callback(status)
def fatuv_walk_callback(uv_handle, c_handles_set): ptr = uv_get_pyobj(uv_handle) handle = ffi.from_handle(ptr) if handle is not None: ffi.from_handle(c_handles_set).add(handle)
def fatuv_exit_callback(process_handle, returncode, signum): ptr = uv_get_pyobj(process_handle) obj = ffi.from_handle(ptr) obj._call_process_callback(returncode, signum)
def fatuv_shutdown_callback(stream_handle, status): ptr = uv_get_pyobj(stream_handle) obj = ffi.from_handle(ptr) obj._call_shutdown_callback(status)
def fatuv_check_callback(check_handle): ptr = uv_get_pyobj(check_handle) obj = ffi.from_handle(ptr) obj._call_check_callback()
def fatuv_idle_callback(idle_handle): ptr = uv_get_pyobj(idle_handle) obj = ffi.from_handle(ptr) obj._call_idle_callback()
def fatuv_timer_callback(timer_handle): ptr = uv_get_pyobj(timer_handle) obj = ffi.from_handle(ptr) obj._call_timer_callback()
def fatuv_fs_event_callback(fs_event_handle, c_filename, events, status): ptr = uv_get_pyobj(fs_event_handle) obj = ffi.from_handle(ptr) filename = ffi.string(c_filename).decode() obj._call_fs_event_callback(filename, events, status)
def fatuv_getaddrinfo_callback(req, addrinfo_request, status): ptr = uv_get_pyobj(req) obj = ffi.from_handle(ptr) obj._call_getaddrinfo_callback(addrinfo_request, status)
def fatuv_tcp_connect_cb(handle, status): # print("fatuv_tcp_connect_cb") ptr = uv_get_pyobj(handle) obj = ffi.from_handle(ptr) # print("fatuv_tcp_connect_cb2") obj._call_tcp_connect_callback(status)