提交 94631594 编写于 作者: Y youngwolf

Fix typos in annotations.

上级 3d18008c
...@@ -113,7 +113,7 @@ public: ...@@ -113,7 +113,7 @@ public:
protected: protected:
//msg handling //msg handling
#ifdef ASCS_SYNC_DISPATCH #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. //access msg_can freely within this callback, it's always thread safe.
virtual size_t on_msg(std::list<out_msg_type>& msg_can) virtual size_t on_msg(std::list<out_msg_type>& msg_can)
{ {
...@@ -129,7 +129,7 @@ protected: ...@@ -129,7 +129,7 @@ protected:
} }
#endif #endif
#ifdef ASCS_DISPATCH_BATCH_MSG #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 //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). // 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) virtual size_t on_msg_handle(out_queue_type& msg_can)
......
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
public: public:
//because we use objects pool(REUSE_OBJECT been defined), so, strictly speaking, this virtual //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 //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();} virtual void reset() {super::reset();}
protected: protected:
...@@ -106,7 +106,7 @@ protected: ...@@ -106,7 +106,7 @@ protected:
//msg handling: send the original msg back(echo server) //msg handling: send the original msg back(echo server)
#ifdef ASCS_SYNC_DISPATCH //do not open this feature #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. //access msg_can freely within this callback, it's always thread safe.
virtual size_t on_msg(std::list<out_msg_type>& msg_can) virtual size_t on_msg(std::list<out_msg_type>& msg_can)
{ {
...@@ -129,7 +129,7 @@ protected: ...@@ -129,7 +129,7 @@ protected:
#endif #endif
#ifdef ASCS_DISPATCH_BATCH_MSG #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 //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). // 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) virtual size_t on_msg_handle(out_queue_type& msg_can)
...@@ -202,13 +202,13 @@ public: ...@@ -202,13 +202,13 @@ public:
protected: protected:
//msg handling //msg handling
#ifdef ASCS_SYNC_DISPATCH #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. //access msg_can freely within this callback, it's always thread safe.
virtual size_t on_msg(std::list<out_msg_type>& msg_can) {auto re = super::on_msg(msg_can); force_shutdown(); return re;} virtual size_t on_msg(std::list<out_msg_type>& msg_can) {auto re = super::on_msg(msg_can); force_shutdown(); return re;}
#endif #endif
#ifdef ASCS_DISPATCH_BATCH_MSG #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 //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). // 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;} virtual size_t on_msg_handle(out_queue_type& msg_can) {auto re = super::on_msg_handle(msg_can); force_shutdown(); return re;}
......
...@@ -16,7 +16,7 @@ public: ...@@ -16,7 +16,7 @@ public:
public: public:
//because we don't use objects pool(we don't defined ASCS_REUSE_OBJECT), so this virtual function will //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 reset();
virtual void take_over(std::shared_ptr<file_socket> socket_ptr); virtual void take_over(std::shared_ptr<file_socket> socket_ptr);
......
...@@ -50,7 +50,7 @@ protected: ...@@ -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();} 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 //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. //access msg_can freely within this callback, it's always thread safe.
virtual size_t on_msg(std::list<out_msg_type>& msg_can) virtual size_t on_msg(std::list<out_msg_type>& msg_can)
{ {
......
...@@ -30,7 +30,7 @@ public: ...@@ -30,7 +30,7 @@ public:
protected: protected:
//msg handling: send the original msg back (echo server), must define macro ASCS_SYNC_DISPATCH //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. //access msg_can freely within this callback, it's always thread safe.
virtual size_t on_msg(std::list<out_msg_type>& msg_can) virtual size_t on_msg(std::list<out_msg_type>& msg_can)
{ {
......
...@@ -328,7 +328,7 @@ public: ...@@ -328,7 +328,7 @@ public:
// //in this function without unique() checking. // //in this function without unique() checking.
// socket_ptr->set_timer(...); // 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()) if ((*iter).unique() && (*iter)->obsoleted())
{ {
--num; --num;
......
...@@ -224,7 +224,7 @@ protected: ...@@ -224,7 +224,7 @@ protected:
//generally, you don't have to rewrite this to maintain the status of connections //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, //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. // 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) 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());} {unified_out::error_out(ASCS_LLF " send msg error (%d %s)", this->id(), ec.value(), ec.message().data());}
......
...@@ -199,7 +199,7 @@ protected: ...@@ -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, //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. // 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) 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());} {unified_out::error_out(ASCS_LLF " send msg error (%d %s)", this->id(), ec.value(), ec.message().data());}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册