@@ -23,7 +23,7 @@ class Listener;
2323// 5. Process TCP client connections and messages in callbacks
2424// 6. At last call Server::Stop() to stop the whole server
2525//
26- // The examples code is as bellow:
26+ // The example code is as bellow:
2727// <code>
2828// std::string addr = "0.0.0.0:9099";
2929// int thread_num = 4;
@@ -62,13 +62,13 @@ class EVPP_EXPORT TCPServer : public ThreadDispatchPolicy, public ServerStatus {
6262 ~TCPServer ();
6363
6464 // @brief Do the initialization works here.
65- // It will create a nonblocking TCP socket, and bind with the give address
65+ // It will create a nonblocking TCP socket, and bind with the given address
6666 // then listen on it. If there is anything wrong it will return false.
67- // @return bool - True if anything goes well
67+ // @return bool - True if everything goes well
6868 bool Init ();
6969
7070 // @brief Start the TCP server and we can accept new connections now.
71- // @return bool - True if anything goes well
71+ // @return bool - True if everything goes well
7272 bool Start ();
7373
7474 // @brief Stop the TCP server
@@ -80,7 +80,7 @@ class EVPP_EXPORT TCPServer : public ThreadDispatchPolicy, public ServerStatus {
8080 void AfterFork ();
8181
8282public:
83- // Set a connection event relative callback when the TCPServer
83+ // Set a connection event relative callback which will be invoked when the TCPServer
8484 // receives a new connection or an exist connection breaks down.
8585 // When these two events happened, the value of the parameter in the callback is:
8686 // 1. Received a new connection : TCPConn::IsConnected() == true
@@ -115,7 +115,7 @@ class EVPP_EXPORT TCPServer : public ThreadDispatchPolicy, public ServerStatus {
115115
116116 DoneCallback stopped_cb_;
117117
118- // always in the listening loop thread
118+ // These two member variables will always be modified in the listening loop thread
119119 uint64_t next_conn_id_ = 0 ;
120120 typedef std::map<uint64_t /* the id of the connection*/ , TCPConnPtr> ConnectionMap;
121121 ConnectionMap connections_;
0 commit comments