(This Article applies to esframework v0.3 +)
In esframework introduction (7)-server proxy iserveragent (Amendment 2006.06.06), we have understood the responsibilities and functions of iserveragent, it is also known that itcpserveragent and iudpserveragent are serveragents used for TCP and UDP respectively. But what is the relationship between these components and other components (such as communication components, message processors, and processor factories)? I am not clear about the above, so I will add an article here. Article To straighten out the relationship. The component relationship diagrams of itcpserveragent and iudpserveragent are as follows:
The preceding two figures clearly describe the dependency between components and the message flow.
Note: The components on the right of the above itcpserveragent and iudpserveragent graph are exactly the same. They are all constructed by iserveragenthelper. The red line indicates sending the message, and the black line indicates the processing process of the received message. We can see that both itcpserveragent and iudpserveragent extract and reply messages from ireeclipsemanager, so that asynchronous message requests/replies can be converted to synchronous "method calls ".
For iudpserveragent, we also need to note that we use the same UDP network component-iesbudp on both the client and server (reusability is the goal of esframework development ), however, the imessagedispatcher assembly by the server for iesbudp is more complex.
In the relationship diagram between the two components, apart from the isinglemessagedealer which needs to be implemented by ourselves, esframework provides reference implementation for all other components and can be directly used.
Finally, the problem is that when the client uses point-to-point communication, if customer a and Customer B can communicate directly, p2pmessage between A and B does not need to be forwarded by the server, that is, it does not need to be submitted to iserveragent, but is sent to ip2pchannel. If Customer A and Customer B cannot communicate directly, the p2pmessage between A and B needs to be forwarded by the server. In order to shield upper-layer applications from p2pmessage from server senders or directly sent through ip2pchannel, esframework introduces imessagetransceiver. Its intelligence is that if p2pmessage can be directly sent through ip2pchannel, then, it is handed over to ip2pchannel. Otherwise, it is submitted to iserveragent and forwarded by the server. In this way, the application only needs to directly use imessagetransceiver to submit (send) messages, instead of caring about the underlying message routing path. More information about imessagetransceiver and ip2pchannel is described below.
Thanks for your attention!
Previous Article: esframework (33)-Implementation of As and FS communication and related
Go to: esframework reusable application framework (sequence)