mirror of
https://github.com/oatpp/oatpp.git
synced 2024-11-21 03:14:51 +08:00
Fixed minore mem leaks
This commit is contained in:
parent
b7ab204a6d
commit
e9191b2b27
@ -36,6 +36,7 @@ public:
|
||||
typedef oatpp::async::Action Action;
|
||||
typedef oatpp::async::Action (oatpp::async::AbstractCoroutine::*AsyncCallback)(const std::shared_ptr<IOStream>&);
|
||||
public:
|
||||
virtual ~ConnectionProvider() {}
|
||||
virtual std::shared_ptr<IOStream> getConnection() = 0;
|
||||
virtual Action getConnectionAsync(oatpp::async::AbstractCoroutine* parentCoroutine,
|
||||
AsyncCallback callback) = 0;
|
||||
|
@ -52,11 +52,21 @@ public:
|
||||
return std::shared_ptr<SimpleTCPConnectionProvider>(new SimpleTCPConnectionProvider(port, nonBlocking));
|
||||
}
|
||||
|
||||
~SimpleTCPConnectionProvider() {
|
||||
oatpp::os::io::Library::handle_close(m_serverHandle);
|
||||
}
|
||||
|
||||
std::shared_ptr<IOStream> getConnection() override;
|
||||
|
||||
Action getConnectionAsync(oatpp::async::AbstractCoroutine* parentCoroutine,
|
||||
AsyncCallback callback) override {
|
||||
throw std::runtime_error("oatpp::network::server::SimpleTCPConnectionProvider::getConnectionAsync not implemented");
|
||||
/**
|
||||
* No need to implement this.
|
||||
* For Asynchronous IO in oatpp it is considered to be a good practice
|
||||
* to accept connections in a seperate thread with the blocking accept()
|
||||
* and then process connections in Asynchronous manner with non-blocking read/write
|
||||
*/
|
||||
throw std::runtime_error("oatpp::network::server::SimpleTCPConnectionProvider::getConnectionAsync not implemented.");
|
||||
}
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user