private void readMessage(SelectionKey sk, SocketChannel readChannel,
TcpAddress incomingAddress) throws IOException {
SocketEntry entry = (SocketEntry) sockets.get(incomingAddress);
if (entry != null) {
// note that socket has been used
entry.used();
ByteBuffer readBuffer = entry.getReadBuffer();
if (readBuffer != null) {
readChannel.read(readBuffer);
if (readBuffer.hasRemaining()) {
entry.addRegistration(selector, SelectionKey.OP_READ);