FastSocket学习笔记~RPC的思想,面向对象的灵活

8/3/2015来源:C#应用人气:3666

FastSocket学习笔记~RPC的思想,面向对象的灵活

首先非常感谢这位来自新浪的老兄,它开发的这个FastSocket非常不错,先不说性能如何,单说它的使用方式和理念上就很让人赞口,从宏观上看,它更像是一种远程过程的调用RPC,即服务器公开一些命令,供客户端去调用,很灵活,而它的理念上来说,它将socket编程抽象化了,让开发人员不用去关心底层通讯机制,而只关心应用层的开发,如开发一个用户模块,你不用关心socket链接怎么声明,不用关心性能,你只要开发和用户相关的内容即可。

看一下图示,我自己画的,呵呵

QQUJwfGNy0wFEBT5v3N78tfJItf/IdO3YMDAwMDY08+eRHn3zyI0NDw/CG+UfaOTg4ODww8D4absYsAM7+yRFAopGRXcPDu4aHd8GZwcHh4eFdIyO7R0Z27RrZvWvkccCm3bv37B7Zs2f3k4+PPPH4rif2PP7kR5742Mc+8sk/fvqzf/5nn//SF//u61/71r//24+f//mvXvvNm8cOnrx8ZvTm2NTc3YXqaq1ZRxiS5ihaoClNEgxVsXXVM3Xf0n1LD2w9csz85g+c0LUiz04CNw3c1Hdj34l9J/Kt2LOy0M1Ctx357cgrICNyzdiz24GbBm478rLQ6UZeO3AT385CrxMH61lUYFA3CdazaKMdb7TjXjtaz+JeGm20k/udtJdF97vJ/U6ynkW91Ie1m3jrWdBNvE7qdVKvE7ud2OtGbi92e7GbBXbs5R8s8U1ANFiTwMwCqxs5aWClgZWFdhbasWdkoZ34ZuYbkasHthrYeurZiWfBoWtInin7luKZgFyabymeKYeOBuddU3Z02dZlz1R9S3MNybcUgC1XExxNsFTe1gRT4WxNcA3B0ljH4C2NNRTaVllXZS2ZsWRalylNIjWJVEXCVBlDITWJMGTKVhlLpk2JUkVCEXBFwA2Z1nhc4TGFJ2SOUDlc4TFNJGWB4KimyCASh4hsU2SbEoeKbEtgEI5qCGRTpJoi1eTwGkfWWbLO4VUOr7FYmSPRLFFj0ArZLFHNEtksEa01tLGC1JaQ2hJaX2lVFptr9xql2UZpt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