From 94631594af47414c6e521ab1370045cacfe329ff Mon Sep 17 00:00:00 2001 From: youngwolf Date: Mon, 15 Feb 2021 15:18:30 +0800 Subject: [PATCH] Fix typos in annotations. --- examples/echo_client/echo_client.cpp | 4 ++-- examples/echo_server/echo_server.cpp | 10 +++++----- examples/file_server/file_socket.h | 2 +- examples/pingpong_client/pingpong_client.cpp | 2 +- examples/pingpong_server/pingpong_server.cpp | 2 +- include/ascs/object_pool.h | 2 +- include/ascs/tcp/socket.h | 2 +- include/ascs/udp/socket.h | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/echo_client/echo_client.cpp b/examples/echo_client/echo_client.cpp index 73fb31a..c885406 100644 --- a/examples/echo_client/echo_client.cpp +++ b/examples/echo_client/echo_client.cpp @@ -113,7 +113,7 @@ public: protected: //msg handling #ifdef ASCS_SYNC_DISPATCH - //do not hold msg_can for further using, return from on_msg as quickly as possible + //do not hold msg_can for further usage, return from on_msg as quickly as possible //access msg_can freely within this callback, it's always thread safe. virtual size_t on_msg(std::list& msg_can) { @@ -129,7 +129,7 @@ protected: } #endif #ifdef ASCS_DISPATCH_BATCH_MSG - //do not hold msg_can for further using, access msg_can and return from on_msg_handle as quickly as possible + //do not hold msg_can for further usage, access msg_can and return from on_msg_handle as quickly as possible //can only access msg_can via functions that marked as 'thread safe', if you used non-lock queue, its your responsibility to guarantee // that new messages will not come until we returned from this callback (for example, pingpong test). virtual size_t on_msg_handle(out_queue_type& msg_can) diff --git a/examples/echo_server/echo_server.cpp b/examples/echo_server/echo_server.cpp index 87c1f13..2bdf367 100644 --- a/examples/echo_server/echo_server.cpp +++ b/examples/echo_server/echo_server.cpp @@ -92,7 +92,7 @@ public: public: //because we use objects pool(REUSE_OBJECT been defined), so, strictly speaking, this virtual //function must be rewrote, but we don't have member variables to initialize but invoke father's - //reset() directly, so, it can be omitted, but we keep it for possibly future using + //reset() directly, so, it can be omitted, but we keep it for the possibility of using it in the future virtual void reset() {super::reset();} protected: @@ -106,7 +106,7 @@ protected: //msg handling: send the original msg back(echo server) #ifdef ASCS_SYNC_DISPATCH //do not open this feature - //do not hold msg_can for further using, return from on_msg as quickly as possible + //do not hold msg_can for further usage, return from on_msg as quickly as possible //access msg_can freely within this callback, it's always thread safe. virtual size_t on_msg(std::list& msg_can) { @@ -129,7 +129,7 @@ protected: #endif #ifdef ASCS_DISPATCH_BATCH_MSG - //do not hold msg_can for further using, access msg_can and return from on_msg_handle as quickly as possible + //do not hold msg_can for further usage, access msg_can and return from on_msg_handle as quickly as possible //can only access msg_can via functions that marked as 'thread safe', if you used non-lock queue, its your responsibility to guarantee // that new messages will not come until we returned from this callback (for example, pingpong test). virtual size_t on_msg_handle(out_queue_type& msg_can) @@ -202,13 +202,13 @@ public: protected: //msg handling #ifdef ASCS_SYNC_DISPATCH - //do not hold msg_can for further using, return from on_msg as quickly as possible + //do not hold msg_can for further usage, return from on_msg as quickly as possible //access msg_can freely within this callback, it's always thread safe. virtual size_t on_msg(std::list& msg_can) {auto re = super::on_msg(msg_can); force_shutdown(); return re;} #endif #ifdef ASCS_DISPATCH_BATCH_MSG - //do not hold msg_can for further using, access msg_can and return from on_msg_handle as quickly as possible + //do not hold msg_can for further usage, access msg_can and return from on_msg_handle as quickly as possible //can only access msg_can via functions that marked as 'thread safe', if you used non-lock queue, its your responsibility to guarantee // that new messages will not come until we returned from this callback (for example, pingpong test). virtual size_t on_msg_handle(out_queue_type& msg_can) {auto re = super::on_msg_handle(msg_can); force_shutdown(); return re;} diff --git a/examples/file_server/file_socket.h b/examples/file_server/file_socket.h index faebb4a..172acb6 100644 --- a/examples/file_server/file_socket.h +++ b/examples/file_server/file_socket.h @@ -16,7 +16,7 @@ public: public: //because we don't use objects pool(we don't defined ASCS_REUSE_OBJECT), so this virtual function will - //not be invoked, and can be omitted, but we keep it for possibly future using + //not be invoked, and can be omitted, but we keep it for the possibility of using it in the future virtual void reset(); virtual void take_over(std::shared_ptr socket_ptr); diff --git a/examples/pingpong_client/pingpong_client.cpp b/examples/pingpong_client/pingpong_client.cpp index a9757c1..b574e29 100644 --- a/examples/pingpong_client/pingpong_client.cpp +++ b/examples/pingpong_client/pingpong_client.cpp @@ -50,7 +50,7 @@ protected: virtual void on_connect() {asio::ip::tcp::no_delay option(true); lowest_layer().set_option(option); client_socket::on_connect();} //msg handling, must define macro ASCS_SYNC_DISPATCH - //do not hold msg_can for further using, access msg_can and return from on_msg as quickly as possible + //do not hold msg_can for further usage, access msg_can and return from on_msg as quickly as possible //access msg_can freely within this callback, it's always thread safe. virtual size_t on_msg(std::list& msg_can) { diff --git a/examples/pingpong_server/pingpong_server.cpp b/examples/pingpong_server/pingpong_server.cpp index 95bfae2..091d1c0 100644 --- a/examples/pingpong_server/pingpong_server.cpp +++ b/examples/pingpong_server/pingpong_server.cpp @@ -30,7 +30,7 @@ public: protected: //msg handling: send the original msg back (echo server), must define macro ASCS_SYNC_DISPATCH - //do not hold msg_can for further using, access msg_can and return from on_msg as quickly as possible + //do not hold msg_can for further usage, access msg_can and return from on_msg as quickly as possible //access msg_can freely within this callback, it's always thread safe. virtual size_t on_msg(std::list& msg_can) { diff --git a/include/ascs/object_pool.h b/include/ascs/object_pool.h index c98b229..3ce7af6 100644 --- a/include/ascs/object_pool.h +++ b/include/ascs/object_pool.h @@ -328,7 +328,7 @@ public: // //in this function without unique() checking. // socket_ptr->set_timer(...); //} - //then in the future, when invoking the timer handler, the socket has been freed and it's this pointer already became wild. + //then in the future, when invoke the timer handler, the socket has been freed and its this pointer already became wild. if ((*iter).unique() && (*iter)->obsoleted()) { --num; diff --git a/include/ascs/tcp/socket.h b/include/ascs/tcp/socket.h index e144c1e..9d9bb34 100644 --- a/include/ascs/tcp/socket.h +++ b/include/ascs/tcp/socket.h @@ -224,7 +224,7 @@ protected: //generally, you don't have to rewrite this to maintain the status of connections //msg_can contains messages that were failed to send and tcp::socket_base will not hold them any more, if you want to re-send them in the future, // you must take over them and re-send (at any time) them via direct_send_msg. - //DO NOT hold msg_can for future using, just swap its content with your own container in this virtual function. + //DO NOT hold msg_can for further usage, just swap its content with your own container in this virtual function. virtual void on_send_error(const asio::error_code& ec, typename super::in_container_type& msg_can) {unified_out::error_out(ASCS_LLF " send msg error (%d %s)", this->id(), ec.value(), ec.message().data());} diff --git a/include/ascs/udp/socket.h b/include/ascs/udp/socket.h index 441a95f..6879a9c 100644 --- a/include/ascs/udp/socket.h +++ b/include/ascs/udp/socket.h @@ -199,7 +199,7 @@ protected: //msg was failed to send and udp::generic_socket will not hold it any more, if you want to re-send it in the future, // you must take over it and re-send (at any time) it via direct_send_msg. - //DO NOT hold msg for future using, just swap its content with your own message in this virtual function. + //DO NOT hold msg for further usage, just swap its content with your own message in this virtual function. virtual void on_send_error(const asio::error_code& ec, typename super::in_msg& msg) {unified_out::error_out(ASCS_LLF " send msg error (%d %s)", this->id(), ec.value(), ec.message().data());} -- GitLab