Skip to content

Commit

Permalink
update agrona dep. Add endpoint info to end of channel status label.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontgomery committed Nov 6, 2019
1 parent 2d15793 commit c5d60ee
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ public void indicateActive()
"channel cannot be registered unless INITIALISING: status=" + status(currentStatus));
}

if (null == multiRcvDestination)
{
statusIndicator.updateLabel(statusIndicator.label() + " " + bindAddressAndPort());
}

statusIndicator.setOrdered(ChannelEndpointStatus.ACTIVE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void indicateActive()
"channel cannot be registered unless INITALIZING: status=" + status(currentStatus));
}

statusIndicator.updateLabel(statusIndicator.label() + " " + bindAddressAndPort());
statusIndicator.setOrdered(ChannelEndpointStatus.ACTIVE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
import org.agrona.concurrent.status.AtomicCounter;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PortUnreachableException;
import java.net.StandardSocketOptions;
import java.net.*;
import java.nio.ByteBuffer;
import java.nio.channels.DatagramChannel;
import java.nio.channels.SelectionKey;
Expand Down Expand Up @@ -208,6 +206,32 @@ public int multicastTtl()
return multicastTtl;
}

/**
* Get the bind address and port in endpoint-style format (ip:port).
*
* Must be called after the channel is opened.
*
* @return the bind address and port in endpoint-style format (ip:port).
*/
public String bindAddressAndPort()
{
try
{
final InetSocketAddress localAddress = (InetSocketAddress)receiveDatagramChannel.getLocalAddress();

if (null == localAddress)
{
return "";
}

return localAddress.getAddress().getHostAddress() + ":" + localAddress.getPort();
}
catch (final IOException ex)
{
return "";
}
}

/**
* Close transport, canceling any pending read operations and closing channel.
*/
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def aeronGroup = 'io.aeron'
def aeronVersion = file('version.txt').text.trim()
def aeronJavaVersion = JavaVersion.VERSION_1_8

def agronaVersion = '1.0.10'
def agronaVersion = '1.0.11'
def sbeVersion = '1.14.0'
def byteBuddyVersion = '1.9.10'
def hdrHistogramVersion = '2.1.11'
Expand Down

0 comments on commit c5d60ee

Please sign in to comment.