summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Clayton <alex.clayton@isode.com>2016-02-05 12:29:28 (GMT)
committerAlex Clayton <alex.clayton@isode.com>2016-02-09 11:26:11 (GMT)
commit2a0022faeefc38a987e3ad55087f3dd45c35a9fb (patch)
treed6f05250c48038b06fd0d1266b5d212bfff55c42 /src/com/isode/stroke/filetransfer/S5BTransportSession.java
parent14ce99a513cf4ac8ff4a2305bd5917285dc14106 (diff)
downloadstroke-2a0022faeefc38a987e3ad55087f3dd45c35a9fb.zip
stroke-2a0022faeefc38a987e3ad55087f3dd45c35a9fb.tar.bz2
Finish porting S5BTransportSession
Finish porting S5BTransportSession to Stroke (previously a lot of it had been commented out). To do so had to introduce a heirachy to the SOCKS5BytestreamSession classes (which were being used as type parameters for the Transport Session) and refactor some of the onByteSent signals to insure they were all of the same type (Integer). Also update PortingProgress.txt to update to give status of some of the porting files. Test-information: Ran unit tests they all still pass. Change-Id: I4295b3a8829c208e65f5a46d19c35090f8c55865
Diffstat (limited to 'src/com/isode/stroke/filetransfer/S5BTransportSession.java')
-rw-r--r--src/com/isode/stroke/filetransfer/S5BTransportSession.java30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/com/isode/stroke/filetransfer/S5BTransportSession.java b/src/com/isode/stroke/filetransfer/S5BTransportSession.java
index 768354f..4cb2a02 100644
--- a/src/com/isode/stroke/filetransfer/S5BTransportSession.java
+++ b/src/com/isode/stroke/filetransfer/S5BTransportSession.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015 Isode Limited.
+ * Copyright (c) 2015-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -11,11 +11,20 @@
package com.isode.stroke.filetransfer;
-import com.isode.stroke.signals.Signal1;
import com.isode.stroke.signals.SignalConnection;
-public class S5BTransportSession<T> extends TransportSession {
+/**
+ * S5BTransportSession
+ *
+ * @param <T> Type of {@link SOCKS5AbstractBytestreamSession} to use.
+ */
+public class S5BTransportSession<T extends SOCKS5AbstractBytestreamSession> extends TransportSession {
+ /**
+ * Constructor for a read byte stream
+ * @param session byte stream session. Should not be {@code null}.
+ * @param readStream read byte stream. Should not be {@code null}.
+ */
public S5BTransportSession(
T session,
ReadBytestream readStream) {
@@ -24,6 +33,11 @@ public class S5BTransportSession<T> extends TransportSession {
initialize();
}
+ /**
+ * Constructor for a write byte stream
+ * @param session byte stream session. Should not be {@code null}.
+ * @param writeStream write byte stream. Should not be {@code null}
+ */
public S5BTransportSession(
T session,
WriteBytestream writeStream) {
@@ -34,20 +48,20 @@ public class S5BTransportSession<T> extends TransportSession {
public void start() {
if (readStream != null) {
- //session.startSending(readStream);
+ session.startSending(readStream);
}
else {
- //session.startReceiving(writeStream);
+ session.startReceiving(writeStream);
}
}
public void stop() {
- //session.stop();
+ session.stop();
}
private void initialize() {
- //finishedConnection = session.onFinished.connect(onFinished);
- //bytesSentConnection = session.onBytesSent.connect(onBytesSent);
+ finishedConnection = session.onFinished.connect(onFinished);
+ bytesSentConnection = session.onBytesSent.connect(onBytesSent);
}
private T session;