Skip to content

Commit

Permalink
Ping over remote relay is working!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
ianopolous committed Dec 30, 2023
1 parent c793e0a commit 35587ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.util.concurrent.*;
import java.util.function.*;
import java.util.stream.*;

import io.netty.handler.codec.protobuf.*;
import org.jetbrains.annotations.*;

public class CircuitHopProtocol extends ProtobufProtocolHandler<CircuitHopProtocol.HopController> {
Expand Down Expand Up @@ -173,6 +175,11 @@ public static class SenderUpgrader extends ChannelInitializer {
protected void initChannel(@NotNull Channel ch) throws Exception {
System.out.println("Removed Hop handler");
ch.pipeline().remove(INITIATOR_HANDLER_NAME);
// also remove associated protobuf handlers
ch.pipeline().remove(ProtobufDecoder.class);
ch.pipeline().remove(ProtobufEncoder.class);
ch.pipeline().remove(ProtobufVarint32FrameDecoder.class);
ch.pipeline().remove(ProtobufVarint32LengthFieldPrepender.class);
ch.pipeline().remove(STREAM_CLEARER_NAME);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.concurrent.*;

import io.netty.channel.*;
import io.netty.handler.codec.protobuf.*;
import org.jetbrains.annotations.*;

public class CircuitStopProtocol
Expand Down Expand Up @@ -77,6 +78,10 @@ public static class ReceiverUpgrader extends ChannelInitializer {
@Override
protected void initChannel(@NotNull Channel ch) throws Exception {
System.out.println("Removed Stop handler");
ch.pipeline().remove(ProtobufDecoder.class);
ch.pipeline().remove(ProtobufEncoder.class);
ch.pipeline().remove(ProtobufVarint32FrameDecoder.class);
ch.pipeline().remove(ProtobufVarint32LengthFieldPrepender.class);
ch.pipeline().remove(RECEIVER_HANDLER_NAME);
ch.pipeline().remove(STREAM_CLEARER_NAME);
}
Expand Down

0 comments on commit 35587ff

Please sign in to comment.