M
meselfo
Im trying to write a small nio server. Its ServerChannel is configured
for nonblocking operation. When a SocketChannel becomes readable I
read the data into a ByteBuffer - but the data may not be complete so
I cant start processing it right away - so where do I store the data
untill I have a complete message? I use the same byte buffer whenever
data becomes readable on a socketchannel. The data is XML fragments
and I only want to start parsing it once I have the end tag of the
fragment.
for nonblocking operation. When a SocketChannel becomes readable I
read the data into a ByteBuffer - but the data may not be complete so
I cant start processing it right away - so where do I store the data
untill I have a complete message? I use the same byte buffer whenever
data becomes readable on a socketchannel. The data is XML fragments
and I only want to start parsing it once I have the end tag of the
fragment.