X-Git-Url: http://git.megacz.com/?p=org.ibex.io.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fio%2FConnection.java;fp=src%2Forg%2Fibex%2Fio%2FConnection.java;h=a6eda45f099c40dcb75f85a464ad5aac6d419811;hp=4233315989a408b038dc0265ad630b0f55a36e19;hb=ed380c04d86942dcb21506d27af41f81d0d29a1f;hpb=7631bf02130d0cd6e0263a941614d33e3831276b diff --git a/src/org/ibex/io/Connection.java b/src/org/ibex/io/Connection.java index 4233315..a6eda45 100644 --- a/src/org/ibex/io/Connection.java +++ b/src/org/ibex/io/Connection.java @@ -12,6 +12,7 @@ public class Connection extends Stream { public Connection(Socket s, String vhost) { super(s); this.vhost = vhost; this.s = s; } public void close() { try{s.close();}catch(Exception e){throw new StreamException(e);} super.close(); } public int getLocalPort() { return s.getLocalPort(); } + public InetAddress getLocalAddress() { return ((InetSocketAddress)s.getLocalSocketAddress()).getAddress(); } public int getRemotePort() { return s.getPort(); } public InetAddress getRemoteAddress() { return ((InetSocketAddress)s.getRemoteSocketAddress()).getAddress(); } public String getRemoteHostname() { return getRemoteAddress().getHostName(); }