mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Remove unused constants
This commit is contained in:
@@ -7,14 +7,14 @@
|
|||||||
#ifndef __AUTOSOCKET_H_
|
#ifndef __AUTOSOCKET_H_
|
||||||
#define __AUTOSOCKET_H_
|
#define __AUTOSOCKET_H_
|
||||||
|
|
||||||
|
namespace basio = boost::asio;
|
||||||
|
namespace bassl = basio::ssl;
|
||||||
|
|
||||||
// Socket wrapper that supports both SSL and non-SSL connections.
|
// Socket wrapper that supports both SSL and non-SSL connections.
|
||||||
// Generally, handle it as you would an SSL connection.
|
// Generally, handle it as you would an SSL connection.
|
||||||
// To force a non-SSL connection, just don't call async_handshake.
|
// To force a non-SSL connection, just don't call async_handshake.
|
||||||
// To force SSL only inbound, call setSSLOnly.
|
// To force SSL only inbound, call setSSLOnly.
|
||||||
|
|
||||||
namespace basio = boost::asio;
|
|
||||||
namespace bassl = basio::ssl;
|
|
||||||
|
|
||||||
class AutoSocket
|
class AutoSocket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -118,7 +118,8 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ShutdownHandler> void async_shutdown (ShutdownHandler handler)
|
template <typename ShutdownHandler>
|
||||||
|
void async_shutdown (ShutdownHandler handler)
|
||||||
{
|
{
|
||||||
if (isSecure ())
|
if (isSecure ())
|
||||||
mSocket->async_shutdown (handler);
|
mSocket->async_shutdown (handler);
|
||||||
@@ -137,7 +138,8 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Seq, typename Handler> void async_read_some (const Seq& buffers, Handler handler)
|
template <typename Seq, typename Handler>
|
||||||
|
void async_read_some (const Seq& buffers, Handler handler)
|
||||||
{
|
{
|
||||||
if (isSecure ())
|
if (isSecure ())
|
||||||
mSocket->async_read_some (buffers, handler);
|
mSocket->async_read_some (buffers, handler);
|
||||||
@@ -172,7 +174,8 @@ public:
|
|||||||
basio::async_read_until (PlainSocket (), buffers, cond, handler);
|
basio::async_read_until (PlainSocket (), buffers, cond, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Buf, typename Handler> void async_write (const Buf& buffers, Handler handler)
|
template <typename Buf, typename Handler>
|
||||||
|
void async_write (const Buf& buffers, Handler handler)
|
||||||
{
|
{
|
||||||
if (isSecure ())
|
if (isSecure ())
|
||||||
boost::asio::async_write (*mSocket, buffers, handler);
|
boost::asio::async_write (*mSocket, buffers, handler);
|
||||||
@@ -207,7 +210,8 @@ public:
|
|||||||
boost::asio::async_read (PlainSocket (), buffers, cond, handler);
|
boost::asio::async_read (PlainSocket (), buffers, cond, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Buf, typename Handler> void async_read (const Buf& buffers, Handler handler)
|
template <typename Buf, typename Handler>
|
||||||
|
void async_read (const Buf& buffers, Handler handler)
|
||||||
{
|
{
|
||||||
if (isSecure ())
|
if (isSecure ())
|
||||||
boost::asio::async_read (*mSocket, buffers, handler);
|
boost::asio::async_read (*mSocket, buffers, handler);
|
||||||
@@ -215,7 +219,8 @@ public:
|
|||||||
boost::asio::async_read (PlainSocket (), buffers, handler);
|
boost::asio::async_read (PlainSocket (), buffers, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Seq, typename Handler> void async_write_some (const Seq& buffers, Handler handler)
|
template <typename Seq, typename Handler>
|
||||||
|
void async_write_some (const Seq& buffers, Handler handler)
|
||||||
{
|
{
|
||||||
if (isSecure ())
|
if (isSecure ())
|
||||||
mSocket->async_write_some (buffers, handler);
|
mSocket->async_write_some (buffers, handler);
|
||||||
@@ -265,5 +270,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// vim:ts=4
|
|
||||||
|
|||||||
@@ -30,10 +30,11 @@ public:
|
|||||||
|
|
||||||
void handleConnect (const boost::system::error_code & error, boost::asio::ip::tcp::resolver::iterator it);
|
void handleConnect (const boost::system::error_code & error, boost::asio::ip::tcp::resolver::iterator it);
|
||||||
|
|
||||||
std::string& getIP ()
|
std::string const& getIP ()
|
||||||
{
|
{
|
||||||
return mIpPort.first;
|
return mIpPort.first;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getDisplayName ()
|
std::string getDisplayName ()
|
||||||
{
|
{
|
||||||
return mCluster ? mNodeName : mIpPort.first;
|
return mCluster ? mNodeName : mIpPort.first;
|
||||||
|
|||||||
@@ -20,14 +20,6 @@ public:
|
|||||||
typedef boost::shared_ptr <Peer> pointer;
|
typedef boost::shared_ptr <Peer> pointer;
|
||||||
typedef pointer const& ref;
|
typedef pointer const& ref;
|
||||||
|
|
||||||
static int const psbGotHello = 0;
|
|
||||||
static int const psbSentHello = 1;
|
|
||||||
static int const psbInMap = 2;
|
|
||||||
static int const psbTrusted = 3;
|
|
||||||
static int const psbNoLedgers = 4;
|
|
||||||
static int const psbNoTransactions = 5;
|
|
||||||
static int const psbDownLevel = 6;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static pointer New (boost::asio::io_service& io_service,
|
static pointer New (boost::asio::io_service& io_service,
|
||||||
boost::asio::ssl::context& ctx,
|
boost::asio::ssl::context& ctx,
|
||||||
@@ -38,7 +30,7 @@ public:
|
|||||||
virtual void handleConnect (const boost::system::error_code& error,
|
virtual void handleConnect (const boost::system::error_code& error,
|
||||||
boost::asio::ip::tcp::resolver::iterator it) = 0;
|
boost::asio::ip::tcp::resolver::iterator it) = 0;
|
||||||
|
|
||||||
virtual std::string& getIP () = 0;
|
virtual std::string const& getIP () = 0;
|
||||||
|
|
||||||
virtual std::string getDisplayName () = 0;
|
virtual std::string getDisplayName () = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user