This is not actually a bug, because the spec states that the method returns `null` if the channel is not connected:

> {@code null} if this channel is not connected.

But could be an improvement because it is useful to have this information in some error handlers. Agree. If `channelInactive` cannot see remote address, how could it reconnect?
In case of connection issue channel.remoteAddress() returns null
### Expected behavior

It should return the request address, which is correctly passed into the `AnnotatedConnectionException`:

`
        protected final Throwable annotateConnectException(Throwable cause, SocketAddress remoteAddress) {
...
}
`

### Actual behavior

It returns `null` when trying to get it from the channel on receiving an exception.

### Steps to reproduce

### Minimal yet complete reproducer code (or URL to code)

### Netty version

4.x.x.

### JVM version (e.g. `java -version`)

### OS version (e.g. `uname -a`)

transport/src/main/java/io/netty/channel/nio/AbstractNioChannel.java
transport/src/main/java/io/netty/channel/nio/AbstractNioChannel.java
diff --git a/transport/src/main/java/io/netty/channel/nio/AbstractNioChannel.java b/transport/src/main/java/io/netty/channel/nio/AbstractNioChannel.java
index 01467b98361..74f798e7aca 100644
--- a/transport/src/main/java/io/netty/channel/nio/AbstractNioChannel.java
+++ b/transport/src/main/java/io/netty/channel/nio/AbstractNioChannel.java
@@ -515,4 +515,13 @@ protected void doClose() throws Exception {
             connectTimeoutFuture = null;
         }
     }
+
+    @Override
+    public SocketAddress remoteAddress() {
+        final SocketAddress remoteAddress = super.remoteAddress();
+        if (remoteAddress == null) {
+            return requestedRemoteAddress;
+        }
+        return remoteAddress;
+    }
 }
