summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer/SOCKS5BytestreamServerSession.h')
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamServerSession.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h
index 4557a36..0b35e4a 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h
+++ b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h
@@ -9,4 +9,5 @@
#include <boost/shared_ptr.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/Network/Connection.h>
@@ -18,5 +19,5 @@ namespace Swift {
class SOCKS5BytestreamRegistry;
- class SOCKS5BytestreamServerSession {
+ class SWIFTEN_API SOCKS5BytestreamServerSession {
public:
typedef boost::shared_ptr<SOCKS5BytestreamServerSession> ref;
@@ -30,5 +31,5 @@ namespace Swift {
ReadingData,
WritingData,
- Finished,
+ Finished
};
@@ -43,10 +44,16 @@ namespace Swift {
void stop();
- void startTransfer();
+ void startSending(boost::shared_ptr<ReadBytestream>);
+ void startReceiving(boost::shared_ptr<WriteBytestream>);
+
HostAddressPort getAddressPort() const;
boost::signal<void (boost::optional<FileTransferError>)> onFinished;
- boost::signal<void (int)> onBytesSent;
- boost::signal<void (int)> onBytesReceived;
+ boost::signal<void (unsigned long long)> onBytesSent;
+ // boost::signal<void (unsigned long long)> onBytesReceived;
+
+ const std::string& getStreamID() const {
+ return streamID;
+ }
private:
@@ -55,4 +62,5 @@ namespace Swift {
void handleDataRead(boost::shared_ptr<SafeByteArray>);
void handleDisconnected(const boost::optional<Connection::Error>&);
+ void handleDataAvailable();
void sendData();
@@ -63,6 +71,14 @@ namespace Swift {
State state;
int chunkSize;
+ std::string streamID;
boost::shared_ptr<ReadBytestream> readBytestream;
boost::shared_ptr<WriteBytestream> writeBytestream;
+ bool waitingForData;
+
+ boost::bsignals::connection disconnectedConnection;
+ boost::bsignals::connection dataReadConnection;
+ boost::bsignals::connection dataWrittenConnection;
+ boost::bsignals::connection dataAvailableConnection;
+
};
}