use of loghub.IpConnectionContext in project LogHub by fbacchella.
the class NettyIpReceiver method getConnectionContext.
@Override
public ConnectionContext getConnectionContext(ChannelHandlerContext ctx, SM message) {
InetSocketAddress remoteaddr = null;
InetSocketAddress localaddr = null;
SocketAddress remoteddr = ctx.channel().remoteAddress();
SocketAddress localddr = ctx.channel().localAddress();
if (remoteddr instanceof InetSocketAddress) {
remoteaddr = (InetSocketAddress) remoteddr;
}
if (localddr instanceof InetSocketAddress) {
remoteaddr = (InetSocketAddress) remoteddr;
}
return new IpConnectionContext(localaddr, remoteaddr, null);
}
Aggregations