Variant f_stream_socket_get_name(CObjRef handle, bool want_peer) { Variant address, port; bool ret; if (want_peer) { ret = f_socket_getpeername(handle, ref(address), ref(port)); } else { ret = f_socket_getsockname(handle, ref(address), ref(port)); } if (ret) { return address.toString() + ":" + port.toString(); } return false; }
// Grab the ip address and port of the client that is connected to this proxy. bool DebuggerProxy::getClientConnectionInfo(VRefParam address, VRefParam port) { Resource s(m_thrift.getSocket().get()); return f_socket_getpeername(s, address, port); }