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
+8 -3
View File
@@ -1273,7 +1273,7 @@ void *ue_standalone_pnf_task(void *context)
{
struct sockaddr_in server_address;
socklen_t addr_len = sizeof(server_address);
char buffer[1024];
char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE];
int sd = ue_rx_sock_descriptor;
assert(sd > 0);
@@ -1283,12 +1283,17 @@ void *ue_standalone_pnf_task(void *context)
bool dl_config_req_valid = false;
while (true)
{
ssize_t len = recvfrom(sd, buffer, sizeof(buffer), 0, (struct sockaddr *)&server_address, &addr_len);
ssize_t len = recvfrom(sd, buffer, sizeof(buffer), MSG_TRUNC, (struct sockaddr *)&server_address, &addr_len);
if (len == -1)
{
LOG_E(MAC, "reading from standalone pnf sctp socket failed \n");
continue;
}
if (len > sizeof(buffer))
{
LOG_E(MAC, "%s(%d). Message truncated. %zd\n", __FUNCTION__, __LINE__, len);
continue;
}
if (len == sizeof(uint16_t))
{
@@ -1660,7 +1665,7 @@ static void print_rx_ind(nfapi_rx_indication_t *p)
void send_standalone_msg(UL_IND_t *UL, nfapi_message_id_e msg_type)
{
int encoded_size = -1;
char buffer[1024];
char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE];
switch (msg_type)
{
+1
View File
@@ -19,6 +19,7 @@
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
//#include "openair1/PHY/defs.h"
//#include "openair1/PHY/LTE_TRANSPORT/defs.h"
#include "nfapi/open-nFAPI/pnf/inc/pnf_p7.h"
#include "queue.h"
#define NUM_MCS 28