package org.opendaylight.openflowjava.protocol.api.connection;
+import java.net.InetSocketAddress;
import java.util.concurrent.Future;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener;
*/
public boolean isAlive();
+ /**
+ * @return address of the remote end - address of a switch if connected
+ */
+ public InetSocketAddress getRemoteAddress();
/**
* @param messageListener here will be pushed all messages from switch
*/
package org.opendaylight.openflowjava.protocol.impl.connection;
-import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.socket.SocketChannel;
import io.netty.util.concurrent.GenericFutureListener;
+import java.net.InetSocketAddress;
import java.util.concurrent.Future;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
private final Cache<RpcResponseKey, ResponseExpectedRpcListener<?>> responseCache;
private final ChannelOutboundQueue output;
- private final Channel channel;
+ private final SocketChannel channel;
private ConnectionReadyListener connectionReadyListener;
private OpenflowProtocolListener messageListener;
final ConnectionReadyListener connectionReadyListener) {
this.connectionReadyListener = connectionReadyListener;
}
+
+ @Override
+ public InetSocketAddress getRemoteAddress() {
+ return channel.remoteAddress();
+ }
}