mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 01:15:53 +00:00
Remove obsolete AsyncService class
This commit is contained in:
@@ -1184,12 +1184,6 @@
|
||||
<ClCompile Include="..\..\src\ripple_hyperleveldb\ripple_hyperleveldb.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_leveldb\ripple_leveldb.cpp" />
|
||||
<ClCompile Include="..\..\src\ripple_mdb\ripple_mdb.c" />
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\AsyncService.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\RippleSSLContext.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1892,7 +1886,6 @@
|
||||
<ClInclude Include="..\..\src\ripple_hyperleveldb\ripple_hyperleveldb.h" />
|
||||
<ClInclude Include="..\..\src\ripple_leveldb\ripple_leveldb.h" />
|
||||
<ClInclude Include="..\..\src\ripple_mdb\ripple_mdb.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\AsyncService.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\impl\MultiSocketType.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\impl\RPCServerImp.h" />
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\RippleSSLContext.h" />
|
||||
|
||||
@@ -909,9 +909,6 @@
|
||||
<ClCompile Include="..\..\src\ripple_app\main\IoServicePool.cpp">
|
||||
<Filter>[2] Old Ripple\ripple_app\main</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple_net\basics\AsyncService.cpp">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\sophia\ripple_sophia.c">
|
||||
<Filter>[1] Ripple\sophia</Filter>
|
||||
</ClCompile>
|
||||
@@ -1890,9 +1887,6 @@
|
||||
<ClInclude Include="..\..\src\ripple_app\main\IoServicePool.h">
|
||||
<Filter>[2] Old Ripple\ripple_app\main</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple_net\basics\AsyncService.h">
|
||||
<Filter>[2] Old Ripple\ripple_net\basics</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\sophia\ripple_sophia.h">
|
||||
<Filter>[1] Ripple\sophia</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -132,7 +132,7 @@ private:
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
PeerDoor::PeerDoor (Stoppable& parent)
|
||||
: AsyncService ("PeerDoor", parent)
|
||||
: Stoppable ("PeerDoor", parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define RIPPLE_PEERDOOR_H_INCLUDED
|
||||
|
||||
/** Handles incoming connections from peers. */
|
||||
class PeerDoor : public AsyncService
|
||||
class PeerDoor : public Stoppable
|
||||
{
|
||||
protected:
|
||||
explicit PeerDoor (Stoppable& parent);
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
|
||||
AsyncService::AsyncService (char const* name, Stoppable& parent)
|
||||
: Stoppable (name, parent)
|
||||
{
|
||||
}
|
||||
|
||||
AsyncService::~AsyncService ()
|
||||
{
|
||||
// If this goes off it means the
|
||||
// AsyncService API contract was violated.
|
||||
//
|
||||
bassert (m_pendingIo.get() == 0);
|
||||
}
|
||||
|
||||
void AsyncService::serviceCountIoPending ()
|
||||
{
|
||||
++m_pendingIo;
|
||||
}
|
||||
|
||||
bool AsyncService::serviceCountIoComplete (boost::system::error_code const& ec)
|
||||
{
|
||||
// If this goes off, the count is unbalanced.
|
||||
bassert (m_pendingIo.get() > 0);
|
||||
|
||||
--m_pendingIo;
|
||||
|
||||
if (! ec || ec == boost::asio::error::operation_aborted)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void AsyncService::onServiceIoComplete ()
|
||||
{
|
||||
//stopped();
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
|
||||
#ifndef RIPPLE_NET_ASYNCSERVICE_H_INCLUDED
|
||||
#define RIPPLE_NET_ASYNCSERVICE_H_INCLUDED
|
||||
|
||||
/** Stoppable subclass that helps with managing asynchronous stopping. */
|
||||
class AsyncService : public Stoppable
|
||||
{
|
||||
public:
|
||||
/** Create the service with the specified name and parent. */
|
||||
AsyncService (char const* name, Stoppable& parent);
|
||||
|
||||
~AsyncService ();
|
||||
|
||||
/** Increments the count of pending I/O for the service.
|
||||
|
||||
This should be called every time an asynchronous initiating
|
||||
function is called by the derived clas.
|
||||
|
||||
Thread safety:
|
||||
Safe to call from any thread at any time.
|
||||
*/
|
||||
void serviceCountIoPending ();
|
||||
|
||||
/** Decrements the count of pending I/O for the service.
|
||||
|
||||
This should be called at the very beginning of every completion
|
||||
handler function in the derived class.
|
||||
|
||||
Thread safety:
|
||||
Safe to call from any thread at any time.
|
||||
|
||||
@param The error_code of the completed asynchronous opereation.
|
||||
@return `true` if the handler should return immediately.
|
||||
*/
|
||||
bool serviceCountIoComplete (boost::system::error_code const& ec);
|
||||
|
||||
/** Called after a stop notification when all pending I/O is complete.
|
||||
The default implementation calls stopped.
|
||||
@see stopped
|
||||
*/
|
||||
virtual void onServiceIoComplete ();
|
||||
|
||||
private:
|
||||
Atomic <int> m_pendingIo;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -360,7 +360,7 @@ private:
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
SNTPClient::SNTPClient (Stoppable& parent)
|
||||
: AsyncService ("SNTPClient", parent)
|
||||
: Stoppable ("SNTPClient", parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef RIPPLE_NET_BASICS_SNTPCLIENT_H_INCLUDED
|
||||
#define RIPPLE_NET_BASICS_SNTPCLIENT_H_INCLUDED
|
||||
|
||||
class SNTPClient : public AsyncService
|
||||
class SNTPClient : public Stoppable
|
||||
{
|
||||
protected:
|
||||
explicit SNTPClient (Stoppable& parent);
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
namespace ripple
|
||||
{
|
||||
|
||||
#include "basics/AsyncService.cpp"
|
||||
#include "basics/HTTPRequest.cpp"
|
||||
#include "basics/HTTPClient.cpp"
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
namespace ripple
|
||||
{
|
||||
|
||||
#include "basics/AsyncService.h"
|
||||
#include "basics/RippleSSLContext.h"
|
||||
#include "basics/MultiSocket.h"
|
||||
#include "basics/HTTPRequest.h"
|
||||
|
||||
Reference in New Issue
Block a user