Netty的写:异步,但是可以保证顺序

Netty的写是异步的,但可以保证两个消息写出的顺序与它们在代码中被写出的先后顺序相同。

handshaker.handshake(...);   
channel.write(myFirstTextWebSocketFrame);

会不会因为异步,导致上面代码中 text frame比handshake response更先到达客户端?  答案是不会:(这人是netty开发者之一)

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.