[Learning] IntelliJ IDEA 14, Netty build the fourth day

This note finishing very messy, sorry sorry, try to write it better. Back to continue gathering information.

Recent netty project encountered several problems First down:

1, the server how to represent each link, and then when business needs, the issued instructions to communicate how to find the link under?

Referring https://segmentfault.com/q/1010000005112923/a-1020000016928422  , approach is to summarize: each receiving client is connected to these clients id down, then the server id specific instruction issued.

2, how to deal with the issue stick package?

Some knowledge do finishing point:

1, ChannelFuture: Interface,

2、ChannelPipeline:

 

Docking packet processing flow is as follows:

1, the client is connected;

2, the client sends the packets;

3, first determine whether the packet belongs to one protocol format? If one of these protocols, proceed to step 4, otherwise, the connection is disconnected client terminal;

4, parses the packet, obtain the message from the device id;

5, to exchange messages;

 

Remaining problem:

1, if an error message appears, do not need to be disconnected;

2, if a link is connected to the background for a long time does not send the message, consume server resources? The link is disconnected or need?

Published 125 original articles · won praise 9 · views 30000 +

Guess you like

Origin blog.csdn.net/jiezhang656/article/details/103777056