aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlibmemory
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-12-21 16:23:09 -0800
committerDamjan Marion <dmarion@me.com>2018-12-22 08:07:21 +0000
commit66a1003f1707c16b183aafb19f7208c4f5641965 (patch)
treef21a96444d96e5a76b49cfec81ff9e857285719b /src/vlibmemory
parent844a36d1a69625f7a7781c9f82b276cbbc748033 (diff)
bapi/vat: fix socket transport for vat
Change-Id: I8e39df129f80c8d3d73181fc5d3ac60ae382a6b6 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vlibmemory')
-rw-r--r--src/vlibmemory/socket_client.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/vlibmemory/socket_client.c b/src/vlibmemory/socket_client.c
index 43294a0ab6e..38bcc2a5156 100644
--- a/src/vlibmemory/socket_client.c
+++ b/src/vlibmemory/socket_client.c
@@ -79,6 +79,9 @@ vl_socket_client_read (int wait)
scm->socket_buffer_size);
if (n < 0)
{
+ if (errno == EAGAIN)
+ continue;
+
clib_unix_warning ("socket_read");
return -1;
}
@@ -103,8 +106,11 @@ vl_socket_client_read (int wait)
n = read (scm->socket_fd,
scm->socket_rx_buffer + vec_len (scm->socket_rx_buffer),
msg_size - vec_len (scm->socket_rx_buffer));
- if (n < 0 && errno != EAGAIN)
+ if (n < 0)
{
+ if (errno == EAGAIN)
+ continue;
+
clib_unix_warning ("socket_read");
return -1;
}
@@ -358,7 +364,8 @@ vl_socket_client_connect (char *socket_path, char *client_name,
sock = &scm->client_socket;
sock->config = socket_path;
- sock->flags = CLIB_SOCKET_F_IS_CLIENT | CLIB_SOCKET_F_SEQPACKET;
+ sock->flags = CLIB_SOCKET_F_IS_CLIENT
+ | CLIB_SOCKET_F_SEQPACKET | CLIB_SOCKET_F_NON_BLOCKING_CONNECT;
if ((error = clib_socket_init (sock)))
{