Skip to content
Permalink
Browse files
comment fix
  • Loading branch information
jamesge committed May 18, 2022
1 parent 28227f5 commit bf6791d81933877ca51671eb8078155723cda616
Showing 2 changed files with 10 additions and 12 deletions.
@@ -27,8 +27,8 @@ namespace brpc {

// Inherit this class to be intrusively shared. Comparing to shared_ptr,
// intrusive_ptr saves one malloc (for shared_count) and gets better cache
// locality when the ref/deref are frequent, in the cost of inability of
// weak_ptr and worse interfacing.
// locality when the ref/deref are frequent, in the cost of lack of weak_ptr
// and worse interface.
class SharedObject {
friend void intrusive_ptr_add_ref(SharedObject*);
friend void intrusive_ptr_release(SharedObject*);
@@ -30,20 +30,18 @@ class SocketMessage {
public:
virtual ~SocketMessage() {}

// Called once and only once *sequentially* to generate the buffer to
// write. This object should destroy itself at the end of this method.
// AppendAndDestroySelf() to the same Socket are called one by one in the
// same sequence as their generated data are written into the file
// descriptor. AppendAndDestroySelf() are called _after_ completion of
// connecting including AppConnect.
// Called once and only once to generate the buffer to write.
// This object should destroy itself at the end of this method.
// AppendAndDestroySelf()-s to a Socket are called one by one and the
// generated data are written into the file descriptor in the same order.
// AppendAndDestroySelf() are called _after_ completion of connecting
// including AppConnect.
// Params:
// out - The buffer to be generated, being empty initially, could
// remain empty after being called.
// sock - the socket to write. NULL when the message is abandoned,
// namely the socket is broken or AppendAndDestroySelf() is
// called by SocketMessagePtr<T>
// sock - the socket to write. NULL when the message will be abandoned
// If the status returned is an error, WriteOptions.id_wait (if absent)
// will be signalled with the error. Other messages are not affected.
// will be signaled with the error. Other messages are not affected.
virtual butil::Status AppendAndDestroySelf(butil::IOBuf* out, Socket* sock) = 0;

// Estimated size of the buffer generated by AppendAndDestroySelf()

0 comments on commit bf6791d

Please sign in to comment.