Client Architecture
We had a brief look at MINA based Server Architecture, lets see how Client looks like. Clients need to connect to a Server, send message and process the responses.
让我们看看客户端是怎么工作的,客户端需要连接服务端发送消息和处理响应
- Client first creates an IOConnector (MINA Construct for connecting to Socket), initiates a bind with Server
- Upon Connection creation, a Session is created and is associated with Connection
- Application/Client writes to the Session, resulting in data being sent to Server, after traversing the Filter Chain
- All the responses/messages received from Server are traverses the Filter Chain and lands at IOHandler, for processing
客户端要创建一个ioconnector 绑定服务端
根据上面的连接一个会话被创建
信息写入session 然后经过filter chain过滤器链 然后传送到服务端
所有的响应信息或者消息经过 过滤器连filter chain后传送给iohandler 处理
转载于:https://blog.51cto.com/techzone/1083015