Dan Snow
Dan Snow

Reputation: 127

Some questions about NIO and socket

Hello I'm currently trying to learn the NIO paradigm and have some question in order to understand better this way of coding. In non-blocking mode :

Thanks for your help

Upvotes: 0

Views: 70

Answers (1)

user207421
user207421

Reputation: 310884

Why should I use a selector for the writing process?

You shouldn't, unless you have had a zero-length write.

why not directly use the write method if i have a hmi.

Exactly, that's what you should normally do.

how could I read a single line from a byteBuffer?

A byte at a time. It doesn't have a notion of lines.

Upvotes: 2

Related Questions