diff options
author | Tobias Markmann <tm@ayena.de> | 2015-03-08 15:36:49 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-05-01 17:14:55 (GMT) |
commit | 794fec2873e69ec047974416768b32b69754dad1 (patch) | |
tree | a3cc8cb221e9ee7ad5c40a9de0ccc03e5f9d9562 /Swiften/FileTransfer/SOCKS5BytestreamServerResourceUser.h | |
parent | d7bc3a37f4bb261c8520a8ddedcda2369f97361c (diff) | |
download | swift-794fec2873e69ec047974416768b32b69754dad1.zip swift-794fec2873e69ec047974416768b32b69754dad1.tar.bz2 |
Add resource management for S5B server and port forwardings
This patchs adds management of the SOCKS5 bytestream server and port
forwarding setup to Swiften. The first file-transfer, regardless of
incoming or outgoing transfer, will start and initialize the S5B server
and if configured try to set up port forwarding. The last file-transfer
to finish will will close the server and remove the port forwarding.
Test-Information:
Tested with upcoming ConcurrentFileTransferTest.cpp and running multiple
S5B file-transfers in parallel.
Change-Id: Idd09d3d0ef9498fc9435b0aee81f2b1061783342
Diffstat (limited to 'Swiften/FileTransfer/SOCKS5BytestreamServerResourceUser.h')
-rw-r--r-- | Swiften/FileTransfer/SOCKS5BytestreamServerResourceUser.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerResourceUser.h b/Swiften/FileTransfer/SOCKS5BytestreamServerResourceUser.h new file mode 100644 index 0000000..014689b --- /dev/null +++ b/Swiften/FileTransfer/SOCKS5BytestreamServerResourceUser.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + +#pragma once + +#include <Swiften/Base/boost_bsignals.h> + +namespace Swift { + +class SOCKS5BytestreamServerManager; + +class SOCKS5BytestreamServerResourceUser { + public: + SOCKS5BytestreamServerResourceUser(SOCKS5BytestreamServerManager* s5bServerManager); + ~SOCKS5BytestreamServerResourceUser(); + + bool isInitialized() const; + + boost::signal<void (bool /* success */)> onSuccessfulInitialized; + + private: + void handleServerManagerInitialized(bool successfulInitialize); + + private: + SOCKS5BytestreamServerManager* s5bServerManager_; +}; + +} |