Galera,
Tenho o seguinte código:
ByteBuffer buf = ByteBuffer.allocateDirect(1024);
//byte[] messageRX = null;
//DGBufferMessage<ByteBuffer> message = null;
int numBytesRead;
try {
numBytesRead = this.sChannel.read(buf);
} catch (IOException e) {
numBytesRead = -1;
}
O problema é que a variavel numBytesRead esta ficando sempre com o valor 0.
Estou conectando assim ao Socket:
this.sChannel = SocketChannel.open();
this.sChannel.connect(new InetSocketAddress(host,port));
this.sChannel.configureBlocking(false);
Ou seja bem simples, sei que teria que colocar o código inteiro aqui para melhor achar uma solução, mas queria ideia de onde começar a “investigar” este problema.
Obrigado. :-o