//if you used object pool(define ASCS_REUSE_OBJECT or ASCS_RESTORE_OBJECT), you can manually call this function to free some objects
// after the object pool(invalid_object_size()) goes big enough for memory saving (because the objects in invalid_object_can
// after the object pool(invalid_object_size()) gets big enough for memory saving (because the objects in invalid_object_can
// are waiting for reusing and will never be freed).
//if you don't used object pool, object_pool will invoke this function automatically and periodically, so you don't need to invoke this function exactly
//because all objects are dynamic created and stored in object_can, maybe when receiving error occur
//(you are recommended to delete the object from object_can, for example via i_server::del_socket), some other asynchronous calls are still queued in asio::io_service,
//(you are recommended to delete the object from object_can, for example via i_server::del_socket), some other asynchronous calls are still queued in asio::io_context,
//and will be dequeued in the future, we must guarantee these objects not be freed from the heap or reused, so we move these objects from object_can to invalid_object_can,
//and free them from the heap or reuse them in the near future.
//if ASCS_CLEAR_OBJECT_INTERVAL been defined, clear_obsoleted_object() will be invoked automatically and periodically to move all invalid objects into invalid_object_can.
std::list<out_msg>temp_msg_buffer;//the size of this list is always very small, so std::list is enough (std::list::size maybe has linear complexity)
//subclass will invoke handle_msg() when got some msgs. if these msgs can't be dispatched via on_msg() because of congestion control opened,
//socket will delay 50 milliseconds(non-blocking) to invoke handle_msg() again, temp_msg_buffer is used to hold these msgs temporarily.
//socket will delay 'msg_handling_interval_step1_' milliseconds(non-blocking) to invoke handle_msg() again, temp_msg_buffer is used to hold these msgs temporarily.
volatileboolsending;
std::atomic_flagsend_atomic;
...
...
@@ -426,9 +472,9 @@ protected:
structstatisticstat;
typenamestatistic::stat_timerecv_idle_begin_time;
boolrecv_idle_began;
//used by heartbeat function, subclass need to refresh them