*/
virtual void getLocalAddress(SocketAddress* address) const = 0;
+ /**
+ * Get the address of the remote endpoint to which this transport is
+ * connected.
+ *
+ * This function may throw AsyncSocketException on error.
+ *
+ * @return Return the local address
+ */
+ SocketAddress getLocalAddress() const {
+ SocketAddress addr;
+ getLocalAddress(&addr);
+ return addr;
+ }
+
virtual void getAddress(SocketAddress* address) const {
getLocalAddress(address);
}
*/
virtual void getPeerAddress(SocketAddress* address) const = 0;
+ /**
+ * Get the address of the remote endpoint to which this transport is
+ * connected.
+ *
+ * This function may throw AsyncSocketException on error.
+ *
+ * @return Return the remote endpoint's address
+ */
+ SocketAddress getPeerAddress() const {
+ SocketAddress addr;
+ getPeerAddress(&addr);
+ return addr;
+ }
+
/**
* Get the certificate used to authenticate the peer.
*/