Updated non-blocking PDCP socket

More accurately, we changed the do/while infinite
loop to be an infinite for loop for the read command of
the socket. The socket file descriptor choice is more clear now.
This commit is contained in:
Melissa
2021-02-09 14:09:39 -08:00
committed by Michael Cook
parent b68479aa10
commit 9fa09f530f
17 changed files with 99 additions and 31 deletions
+5 -1
View File
@@ -409,10 +409,14 @@ static int socket_udp_receive(int socket_fd, void *buf, int size)
socklen_t slen = sizeof(client);
int l;
l = recvfrom(socket_fd, buf, size, 0, (struct sockaddr *) &client, &slen);
l = recvfrom(socket_fd, buf, size, MSG_TRUNC, (struct sockaddr *) &client, &slen);
//getsockname(socket_fd, (struct sockaddr *)&client, &slen);
if (l == -1) goto error;
if (l == 0) goto socket_closed;
if (l > size) {
LOG_E(MAC, "%s(%d). Message truncated. %d\n", __FUNCTION__, __LINE__, l);
return -1;
}
return l;