diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-04-21 17:24:18 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-04-21 17:24:18 +0000 |
commit | 227b2e0226445d0c4f39572f51f55451f9fa90f3 (patch) | |
tree | 2c1fb15b829e3fc1e21ec29c1c5e9f28c7d02dbc /src/common/compat.h | |
parent | 671b990f5168771051b251162698354ebbf39a6c (diff) | |
download | tor-227b2e0226445d0c4f39572f51f55451f9fa90f3.tar tor-227b2e0226445d0c4f39572f51f55451f9fa90f3.tar.gz |
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
Diffstat (limited to 'src/common/compat.h')
-rw-r--r-- | src/common/compat.h | 17 |
1 files changed, 4 insertions, 13 deletions
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) |