MCPcopy Create free account
hub / github.com/axboe/liburing / receivePing

Function receivePing

examples/napi-busy-poll-server.c:199–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199static void receivePing(struct ctx *ctx)
200{
201 struct io_uring_sqe *sqe;
202
203 bzero(&ctx->msg, sizeof(struct msghdr));
204 if (opt.ipv6) {
205 ctx->msg.msg_name = &ctx->saddr6;
206 ctx->msg.msg_namelen = sizeof(struct sockaddr_in6);
207 } else {
208 ctx->msg.msg_name = &ctx->saddr;
209 ctx->msg.msg_namelen = sizeof(struct sockaddr_in);
210 }
211 ctx->iov.iov_base = ctx->buffer;
212 ctx->iov.iov_len = MAXBUFLEN;
213 ctx->msg.msg_iov = &ctx->iov;
214 ctx->msg.msg_iovlen = 1;
215
216 sqe = io_uring_get_sqe(&ctx->ring);
217 io_uring_prep_recvmsg(sqe, ctx->sockfd, &ctx->msg, 0);
218 sqe->user_data = encodeUserData(IOURING_RECVMSG, ctx->sockfd);
219}
220
221static void completion(struct ctx *ctx, struct io_uring_cqe *cqe)
222{

Callers 2

completionFunction · 0.70
mainFunction · 0.70

Calls 2

encodeUserDataFunction · 0.70
io_uring_get_sqeFunction · 0.50

Tested by

no test coverage detected