Skip to content

Commit

Permalink
Set host on Hop protocol in relay transport
Browse files Browse the repository at this point in the history
set Connection attribute
call fireActive in upgradeStream
  • Loading branch information
ianopolous committed Dec 27, 2023
1 parent 4581381 commit c10d756
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public RelayTransport(
@Override
public void setHost(Host us) {
this.us = us;
hop.setHost(us);
}

public static class CandidateRelay {
Expand Down Expand Up @@ -207,6 +208,7 @@ protected void initChannel(Channel channel) throws Exception {
System.out.println(
"Upgrade " + (isInitiator ? "outgoing" : "incoming") + " relay to " + remote);
channel.attr(AttributesKt.getREMOTE_PEER_ID()).set(remote);
channel.attr(AttributesKt.getCONNECTION()).set(conn);
upgrader
.establishSecureChannel(conn)
.thenCompose(
Expand All @@ -230,6 +232,8 @@ protected void initChannel(Channel channel) throws Exception {
res.completeExceptionally(t);
return null;
});
System.out.println("Fire active");
channel.pipeline().fireChannelActive();
}
});
return res;
Expand Down

0 comments on commit c10d756

Please sign in to comment.