in tchannel-core/src/main/java/com/uber/tchannel/channels/PeerManager.java [113:128]
public void setIdentified(@NotNull Channel channel, @NotNull Map<String, String> headers) {
Connection conn = get(channel);
if (conn == null) {
// Handle in connection
conn = new Connection(null, channel, Connection.Direction.IN);
}
conn.setIdentified(headers);
if (!conn.isEphemeral() && conn.direction == Connection.Direction.IN) {
SocketAddress address = conn.getRemoteAddressAsSocketAddress();
channelTable.put(channel.id(), address);
Peer peer = findOrNewPeer(address);
conn.setPeer(peer);
peer.add(conn);
}
}