diff options
Diffstat (limited to 'src/main/java/org/gnunet/util/Connection.java')
-rw-r--r-- | src/main/java/org/gnunet/util/Connection.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/gnunet/util/Connection.java b/src/main/java/org/gnunet/util/Connection.java index 1c569c4..c8b6a48 100644 --- a/src/main/java/org/gnunet/util/Connection.java +++ b/src/main/java/org/gnunet/util/Connection.java | |||
@@ -31,6 +31,7 @@ import java.io.IOException; | |||
31 | import java.net.InetAddress; | 31 | import java.net.InetAddress; |
32 | import java.net.InetSocketAddress; | 32 | import java.net.InetSocketAddress; |
33 | import java.nio.ByteBuffer; | 33 | import java.nio.ByteBuffer; |
34 | import java.nio.channels.SelectionKey; | ||
34 | import java.nio.channels.SocketChannel; | 35 | import java.nio.channels.SocketChannel; |
35 | import java.nio.channels.spi.SelectorProvider; | 36 | import java.nio.channels.spi.SelectorProvider; |
36 | import java.util.LinkedList; | 37 | import java.util.LinkedList; |
@@ -101,7 +102,7 @@ public class Connection { | |||
101 | /** | 102 | /** |
102 | * Timeout task for the connect notify. | 103 | * Timeout task for the connect notify. |
103 | */ | 104 | */ |
104 | private Scheduler.TaskConfiguration notifyConnectedTimeout; | 105 | private Scheduler.TaskIdentifier notifyConnectedTimeout; |
105 | 106 | ||
106 | /** | 107 | /** |
107 | * Continuation to call when connected | 108 | * Continuation to call when connected |
@@ -159,7 +160,7 @@ public class Connection { | |||
159 | private MessageReceiver receiver; | 160 | private MessageReceiver receiver; |
160 | private RelativeTime timeout; | 161 | private RelativeTime timeout; |
161 | private GnunetMessage.Header msgh = null; | 162 | private GnunetMessage.Header msgh = null; |
162 | private Scheduler.TaskConfiguration recvTask = null; | 163 | private Scheduler.TaskIdentifier recvTask = null; |
163 | private boolean finished = false; | 164 | private boolean finished = false; |
164 | // is this receiver actively working? if not, the connection process has to kick off the receiver | 165 | // is this receiver actively working? if not, the connection process has to kick off the receiver |
165 | // (or select behaves badly) | 166 | // (or select behaves badly) |
@@ -367,7 +368,7 @@ public class Connection { | |||
367 | // of a message, only the max. wait time before transmission. | 368 | // of a message, only the max. wait time before transmission. |
368 | // cancel must be called on the transmitTask if we disconnect | 369 | // cancel must be called on the transmitTask if we disconnect |
369 | Scheduler.TaskConfiguration tc = new Scheduler.TaskConfiguration(RelativeTime.FOREVER, this); | 370 | Scheduler.TaskConfiguration tc = new Scheduler.TaskConfiguration(RelativeTime.FOREVER, this); |
370 | tc.selectWrite(connectionChannel); | 371 | tc.addSelectEvent(connectionChannel, SelectionKey.OP_WRITE); |
371 | this.transmitTask = tc.schedule(); | 372 | this.transmitTask = tc.schedule(); |
372 | } | 373 | } |
373 | 374 | ||
@@ -450,7 +451,7 @@ public class Connection { | |||
450 | return; | 451 | return; |
451 | } | 452 | } |
452 | 453 | ||
453 | tc.selectConnect(channel); | 454 | tc.addSelectEvent(channel, SelectionKey.OP_CONNECT); |
454 | 455 | ||
455 | addressProbe.connectTask = tc.schedule(); | 456 | addressProbe.connectTask = tc.schedule(); |
456 | } | 457 | } |