UNIX domain sockets, send timeout, zero copy

I am learning UNIX domain sockets and trying out some client server programs. I am using SOCK_DGRAM family of sockets.

My doubt is:

  1. Is using UNIX domain sockets copy buffer from userspace to kernel space buffers while sending and receiving?

So my call:

sendto(send_thread_socket, (void*)argData, sizeof(*argData), 0,
                                        (struct sockaddr *)&dpdkServer, sizeof(struct sockaddr_un))

will it copy the buffer to some kernel space buffer or will it directly be copied to user space buffer of receiving process. Since UNIX sockets work on file system namespaces I thought it shouldn't do a copy of the buffer.

  1. Since I am using SOCK_DGRAM, will a send timeout make any sense?

Lets say I am using the same sendto() call, but the receiving side does not guarantee any timely collection of data, can I have a Send timeout.

Read more here: https://stackoverflow.com/questions/34772486/unix-domain-sockets-send-timeout-zero-copy

Content Attribution

This content was originally published by RootPhoenix at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: