summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer/SOCKS5BytestreamServerSession.h')
-rw-r--r--Swiften/FileTransfer/SOCKS5BytestreamServerSession.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h
index 4cbda7c..762db8b 100644
--- a/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h
+++ b/Swiften/FileTransfer/SOCKS5BytestreamServerSession.h
@@ -30,7 +30,7 @@ namespace Swift {
ReadyForTransfer,
ReadingData,
WritingData,
- Finished,
+ Finished
};
SOCKS5BytestreamServerSession(boost::shared_ptr<Connection> connection, SOCKS5BytestreamRegistry* registry);
@@ -43,12 +43,18 @@ namespace Swift {
void start();
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:
void finish(bool error);
@@ -64,8 +70,15 @@ namespace Swift {
ByteArray unprocessedData;
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;
+
};
}