From 227b2e0226445d0c4f39572f51f55451f9fa90f3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 21 Apr 2007 17:24:18 +0000 Subject: r12759@Kushana: nickm | 2007-04-20 08:47:20 -0400 Track the number of connection_t separately from the number of open sockets. It is already possible to have connections that do not count: resolving conns, for one. Once we move from socketpairs to linked conns, and once we do dns proxying, there will be lots of such connections. svn:r9994 --- src/common/compat.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/common/compat.h') diff --git a/src/common/compat.h b/src/common/compat.h index a6c339ee7..3f2abc196 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -213,19 +213,10 @@ int touch_file(const char *fname); #endif /* ===== Net compatibility */ -#ifdef USE_BSOCKETS -#define tor_close_socket(s) bclose(s) -#elif defined(MS_WINDOWS) -/** On Windows, you have to call close() on fds returned by open(), - * and closesocket() on fds returned by socket(). On Unix, everything - * gets close()'d. We abstract this difference by always using - * tor_close_socket to close sockets, and always using close() on - * files. - */ -#define tor_close_socket(s) closesocket(s) -#else -#define tor_close_socket(s) close(s) -#endif + +void tor_close_socket(int s); +int tor_open_socket(int domain, int type, int protocol); +int get_n_open_sockets(void); #ifdef USE_BSOCKETS #define tor_socket_send(s, buf, len, flags) bsend(s, buf, len, flags) -- cgit v1.2.3