Topic: The partial record from splice in UDP socket
Whether exists for a call//pipefd contains, at least, 42 bytes for reading//sockfd it is created with flag SOCK_DGRAM ssize_t n = splice (pipefd, 0, sockfd, 0, 42, 0) possibility to receive n distinct from-1, 0, 42? Differently, whether can splice write down only a part of queried data and generate the datagram? In that case the finite receiver receives the trimmed message, because under the standard if the datagram is read reads out it entirely. An additional question: as leads splice, if 1. In pipefd it is less than data, than 42. pipefd and sockfd the locked. 2. The same, only both descriptors not locked. As here often like to ask "what for" I will answer at once: I implement algorithm close to logic of a proxy of the server. The data arrives on pipefd, the title, residual through splice understands goes on sockfd where it is accepted already by a finite feast. Problem place that pipefd works in a streaming mode, and the data can come somehow, and sockfd2 - on UDP where it is necessary to provide integrity of the datagram. Therefore in the type code: struct header header; read (pipefd, &header, sizeof header);//Parse ` header `, do some logic. splice (pipefd, 0, sockfd, 0, header-> size, 0); the Call splice should move exactly header-> size byte.