protocol: Added infinite lingering
This commit is contained in:
parent
cdcea14156
commit
9462d1a97f
1 changed files with 4 additions and 0 deletions
|
@ -40,6 +40,8 @@ int bind_server(void) {
|
|||
if (sock < 0)
|
||||
return -1;
|
||||
|
||||
nn_setsockopt(sock, NN_SOL_SOCKET, NN_LINGER, &(int) {-1}, sizeof (int));
|
||||
|
||||
if (nn_bind(sock, URL) < 0)
|
||||
goto error;
|
||||
|
||||
|
@ -58,6 +60,8 @@ int connect_client(void) {
|
|||
if (sock < 0)
|
||||
return -1;
|
||||
|
||||
nn_setsockopt(sock, NN_SOL_SOCKET, NN_LINGER, &(int) {-1}, sizeof (int));
|
||||
|
||||
if (nn_connect (sock, URL) < 0)
|
||||
goto error;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue