From 3fb0bba684947b645b3e5d765c90990c28fecc56 Mon Sep 17 00:00:00 2001 From: fengzero Date: Thu, 26 Oct 2023 10:51:40 +0000 Subject: [PATCH] delay 10ms --- src/connection/connection.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/connection/connection.c b/src/connection/connection.c index 73639d43..ce48323b 100644 --- a/src/connection/connection.c +++ b/src/connection/connection.c @@ -355,7 +355,12 @@ ssize_t neu_conn_send(neu_conn_t *conn, uint8_t *buf, ssize_t len) conn->fd, len, ret, strerror(errno), errno); break; } else { - sleep(1); + struct timespec t1 = { + .tv_sec = 0, + .tv_nsec = 1000 * 1000 * 10, + }; + struct timespec t2 = { 0 }; + nanosleep(&t1, &t2); retry++; zlog_warn(conn->param.log, "not all data send, retry: %d, ret: "