mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add utility function for RPCServer
This commit is contained in:
@@ -281,6 +281,17 @@ private:
|
||||
boost::asio::placeholders::error)));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
std::string getRemoteAddressText ()
|
||||
{
|
||||
std::string address;
|
||||
|
||||
address = mSocket.PlainSocket ().remote_endpoint ().address ().to_string ();
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
private:
|
||||
NetworkOPs* const mNetOps;
|
||||
|
||||
|
||||
@@ -28,6 +28,12 @@ public:
|
||||
virtual boost::asio::ip::tcp::socket& getRawSocket () = 0;
|
||||
|
||||
virtual void connected () = 0;
|
||||
|
||||
/** Retrieve the remote address as a string.
|
||||
|
||||
@return A std::string representing the remote address.
|
||||
*/
|
||||
virtual std::string getRemoteAddressText () = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user