Mercurial > hg > nnchat
comparison main.c @ 613:2cd71b7c1e8e
Repurpose nn_conn_close() to only close the socket, but not free the
connection structure. Add new function nn_conn_free() to do the freeing
(also calls nn_conn_close()).
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 20 May 2014 06:50:12 +0300 |
parents | 59588bbf8d55 |
children | 1ffacd20b88b |
comparison
equal
deleted
inserted
replaced
612:59588bbf8d55 | 613:2cd71b7c1e8e |
---|---|
2224 else | 2224 else |
2225 { | 2225 { |
2226 printMsg(currWin, "Could not get policy probe.\n"); | 2226 printMsg(currWin, "Could not get policy probe.\n"); |
2227 } | 2227 } |
2228 } | 2228 } |
2229 nn_conn_close(conn); | 2229 nn_conn_free(conn); |
2230 #endif | 2230 #endif |
2231 | 2231 |
2232 // Okay, now do the proper connection ... | 2232 // Okay, now do the proper connection ... |
2233 if (nn_conn_open(conn, optPort, NULL) != 0) | 2233 if (nn_conn_open(conn, optPort, NULL) != 0) |
2234 { | 2234 { |
2350 if (errorMessages) | 2350 if (errorMessages) |
2351 THERR("%s", errorMessages); | 2351 THERR("%s", errorMessages); |
2352 #endif | 2352 #endif |
2353 | 2353 |
2354 th_free(optUserNameEnc); | 2354 th_free(optUserNameEnc); |
2355 nn_conn_close(conn); | 2355 nn_conn_free(conn); |
2356 nn_network_close(); | 2356 nn_network_close(); |
2357 | 2357 |
2358 THMSG(1, "Connection terminated.\n"); | 2358 THMSG(1, "Connection terminated.\n"); |
2359 | 2359 |
2360 return 0; | 2360 return 0; |