[librdmacm] examples/r[io]stream.c: Better handling of rpoll errors during client... master
authorHal Rosenstock <hal@dev.mellanox.co.il>
Wed, 30 Sep 2015 13:06:06 +0000 (09:06 -0400)
committerSean Hefty <sean.hefty@intel.com>
Tue, 6 Oct 2015 20:18:49 +0000 (13:18 -0700)
Rather than silently exiting when connection is refused by server,
print error message (Connection refused) during async rconnect at client.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
examples/riostream.c
examples/rstream.c

index 82dcd59..326028a 100644 (file)
@@ -470,8 +470,10 @@ static int client_connect(void)
                fds.fd = rs;
                fds.events = POLLOUT;
                ret = do_poll(&fds, poll_timeout);
-               if (ret)
+               if (ret) {
+                       perror("rpoll");
                        goto close;
+               }
 
                len = sizeof err;
                ret = rgetsockopt(rs, SOL_SOCKET, SO_ERROR, &err, &len);
index 34144b2..8e1e730 100644 (file)
@@ -469,8 +469,10 @@ static int client_connect(void)
                fds.fd = rs;
                fds.events = POLLOUT;
                ret = do_poll(&fds, poll_timeout);
-               if (ret)
+               if (ret) {
+                       perror("rpoll");
                        goto close;
+               }
 
                len = sizeof err;
                ret = rs_getsockopt(rs, SOL_SOCKET, SO_ERROR, &err, &len);