From 1b6e9985960a1079be81a576d52aa7f3fe47c92b Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 5 Jan 2017 18:02:22 -0800 Subject: Add nng_shutdown() for sockets to help avoid close race. Also we added a two phase shutdown for threads. --- tests/sock.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/sock.c b/tests/sock.c index 929e73c8..e0743936 100644 --- a/tests/sock.c +++ b/tests/sock.c @@ -21,9 +21,11 @@ TestMain("Socket Operations", { So(rv == 0); So(sock != NULL); - Convey("And we can close it", { - rv = nng_close(sock); + Convey("And we can shut it down", { + rv = nng_shutdown(sock); So(rv == 0); + rv = nng_shutdown(sock); + So(rv == NNG_ECLOSED); }) Reset({ -- cgit v1.2.3-70-g09d2