diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-05 18:02:22 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-05 18:02:22 -0800 |
| commit | 1b6e9985960a1079be81a576d52aa7f3fe47c92b (patch) | |
| tree | 2f6c9b33571cf30e28ca721064a9c0d038be4c42 /tests/sock.c | |
| parent | b17703d1e708a99e9a46ceb012676dc89df40df5 (diff) | |
| download | nng-1b6e9985960a1079be81a576d52aa7f3fe47c92b.tar.gz nng-1b6e9985960a1079be81a576d52aa7f3fe47c92b.tar.bz2 nng-1b6e9985960a1079be81a576d52aa7f3fe47c92b.zip | |
Add nng_shutdown() for sockets to help avoid close race.
Also we added a two phase shutdown for threads.
Diffstat (limited to 'tests/sock.c')
| -rw-r--r-- | tests/sock.c | 6 |
1 files changed, 4 insertions, 2 deletions
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({ |
