zchuango commented on issue #3167: URL: https://github.com/apache/brpc/issues/3167#issuecomment-3686203043
> 这种方法看似简单,但实际实现可能会遇到问题,这些方法里面会访问Socket的私有成员,这就意味着具体Transport的实现里面,还要访问Socket的私有成员。这样并没有从根本上解决Socket和Transport解耦的问题,而且会引入新的问题——Socket里和Transport无关的一些代码被复制到多个Transport的实现代码里,增加了维护成本。 > > 因此,我不建议这种改法,我觉得可以这样: > > 将Socket里面,和特定transport相关的私有成员抽取出来到各自的transport中,如 按照这个方式我梳理了下感觉可行,结合个人的理解对需要下推的代码部分梳理,主要思路就是把RDMA宏定义代码段下推到Transport接口中并标识出所属源方法,然后对代码公共部分合并抽象出Transport接口。以下是具体的抽象结果和整理的改进想法,@wwbmmm 可以一起再探讨下看看。 **trasnport接口最新定义:** <img width="402" height="139" alt="Image" src="https://github.com/user-attachments/assets/84839fcb-b05a-4c0d-bd07-95ee29ac47f8" /> **源代码梳理和改进思路:** <img width="670" height="888" alt="Image" src="https://github.com/user-attachments/assets/e8bfd6a1-0851-4b71-bad4-d6ae03718127" /> -- 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]
