wwbmmm commented on issue #3167:
URL: https://github.com/apache/brpc/issues/3167#issuecomment-3649034842
> class Transport{
> public:
> virtual void BeforeRecycled(Socket* socket) = 0;
> virtual int WaitAndReset(Socket* socket, int32_t expected_nref) = 0;
> virtual int StartWrite(Socket* socket, WriteRequest* req,
WriteOptions& opt) = 0;
> virtual void* KeepWrite(void* void_arg) = 0;
> virtual ssize_t DoWrite(Socket* socket, WriteRequest* req) = 0;
> virtual int OnInputEvent(void* user_data, uint32_t events,
bthread_attr_t& thread_attr) = 0;
> virtual void DebugSocket(std::ostream& ostream, SocketId id) = 0;
> }
最上面的Transport层接口是DoConnect/DoRead/DoWrite,为什么到这里变成了WaitAndReset/StartWrite/KeepWrite/DoWrite/OnInputEvent呢?感觉前者更合理些。后者耦合了太多逻辑,比如bthread操作、多路复用、健康检查等。
还有这里TransportWrapper的作用是什么呢?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]