Go to the documentation of this file.
31 static const char MESSAGE[] =
"Failure is for the weak. Everyone dies alone.";
56 ASSERT(
nested == 0 &&
"close_cb must be called from a fresh stack");
64 ASSERT(
nested == 0 &&
"shutdown_cb must be called from a fresh stack");
71 ASSERT(
nested == 0 &&
"read_cb must be called from a fresh stack");
73 printf(
"Read. nread == %d\n", (
int)nread);
79 }
else if (nread < 0) {
100 FATAL(
"uv_shutdown failed");
109 ASSERT(
nested == 0 &&
"timer_cb must be called from a fresh stack");
111 puts(
"Timeout complete. Now read data...");
115 FATAL(
"uv_read_start failed");
129 ASSERT(
nested == 0 &&
"write_cb must be called from a fresh stack");
131 puts(
"Data written. 500ms timeout...");
151 puts(
"Connected. Write some data to echo server...");
154 ASSERT(
nested == 0 &&
"connect_cb must be called from a fresh stack");
162 FATAL(
"uv_write failed");
172 struct sockaddr_in
addr;
177 FATAL(
"uv_tcp_init failed");
180 puts(
"Connecting...");
186 (
const struct sockaddr*) &
addr,
188 FATAL(
"uv_tcp_connect failed");
static const char MESSAGE[]
static uv_connect_t connect_req
static void alloc_cb(uv_handle_t *handle, size_t size, uv_buf_t *buf)
static int connect_cb_called
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
static void read_cb(uv_stream_t *tcp, ssize_t nread, const uv_buf_t *buf)
static int bytes_received
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
static void connect_cb(uv_connect_t *req, int status)
UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb)
UV_EXTERN int uv_tcp_connect(uv_connect_t *req, uv_tcp_t *handle, const struct sockaddr *addr, uv_connect_cb cb)
UV_EXTERN int uv_ip4_addr(const char *ip, int port, struct sockaddr_in *addr)
UV_EXTERN uv_loop_t * uv_default_loop(void)
UV_EXTERN int uv_write(uv_write_t *req, uv_stream_t *handle, const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb)
UV_PRIVATE_REQ_TYPES UV_EXTERN int uv_shutdown(uv_shutdown_t *req, uv_stream_t *handle, uv_shutdown_cb cb)
static int close_cb_called
UV_EXTERN int uv_read_start(uv_stream_t *, uv_alloc_cb alloc_cb, uv_read_cb read_cb)
static uv_write_t write_req
static int write_cb_called
UV_EXTERN int uv_tcp_init(uv_loop_t *, uv_tcp_t *handle)
static int timer_cb_called
static void write_cb(uv_write_t *req, int status)
#define MAKE_VALGRIND_HAPPY()
static void shutdown_cb(uv_shutdown_t *req, int status)
UV_EXTERN int uv_timer_start(uv_timer_t *handle, uv_timer_cb cb, uint64_t timeout, uint64_t repeat)
static int shutdown_cb_called
static void timer_cb(uv_timer_t *handle)
UV_EXTERN int uv_timer_init(uv_loop_t *, uv_timer_t *handle)
static uv_shutdown_t shutdown_req
static void close_cb(uv_handle_t *handle)
TEST_IMPL(callback_stack)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:29