diff options
author | buttercat1791 <mjjurkoic@gmail.com> | 2024-05-31 08:36:07 -0500 |
---|---|---|
committer | buttercat1791 <mjjurkoic@gmail.com> | 2024-05-31 08:36:07 -0500 |
commit | 308840a3a3d80616e5a61bebbcdebb6d8ad99c66 (patch) | |
tree | ce12f499bd19d81278f22cfe05d440bdc2b134a5 /src/client/websocketpp_client.cpp | |
parent | c070fcbdebc237eae47f37fe7f2f50004b9010af (diff) |
Use namespaces in definition files
Diffstat (limited to 'src/client/websocketpp_client.cpp')
-rw-r--r-- | src/client/websocketpp_client.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/client/websocketpp_client.cpp b/src/client/websocketpp_client.cpp index e4f6af6..b8458e6 100644 --- a/src/client/websocketpp_client.cpp +++ b/src/client/websocketpp_client.cpp @@ -2,21 +2,22 @@ #include "client/websocketpp_client.hpp" +using namespace nostr::client; using namespace std; -void nostr::client::WebsocketppClient::start() +void WebsocketppClient::start() { this->_client.init_asio(); this->_client.start_perpetual(); }; -void nostr::client::WebsocketppClient::stop() +void WebsocketppClient::stop() { this->_client.stop_perpetual(); this->_client.stop(); }; -void nostr::client::WebsocketppClient::openConnection(string uri) +void WebsocketppClient::openConnection(string uri) { error_code error; websocketpp_client::connection_ptr connection = this->_client.get_connection(uri, error); @@ -41,13 +42,13 @@ void nostr::client::WebsocketppClient::openConnection(string uri) this->_client.connect(connection); }; -bool nostr::client::WebsocketppClient::isConnected(string uri) +bool WebsocketppClient::isConnected(string uri) { lock_guard<mutex> lock(this->_propertyMutex); return this->_connectionHandles.find(uri) != this->_connectionHandles.end(); }; -tuple<string, bool> nostr::client::WebsocketppClient::send(string message, string uri) +tuple<string, bool> WebsocketppClient::send(string message, string uri) { error_code error; @@ -67,7 +68,7 @@ tuple<string, bool> nostr::client::WebsocketppClient::send(string message, strin return make_tuple(uri, true); }; -tuple<string, bool> nostr::client::WebsocketppClient::send( +tuple<string, bool> WebsocketppClient::send( string message, string uri, function<void(const string&)> messageHandler) @@ -77,7 +78,7 @@ tuple<string, bool> nostr::client::WebsocketppClient::send( return successes; }; -void nostr::client::WebsocketppClient::receive( +void WebsocketppClient::receive( string uri, function<void(const string&)> messageHandler) { @@ -93,7 +94,7 @@ void nostr::client::WebsocketppClient::receive( }); }; -void nostr::client::WebsocketppClient::closeConnection(string uri) +void WebsocketppClient::closeConnection(string uri) { lock_guard<mutex> lock(this->_propertyMutex); |