Changed TCPServer to guarantee sending of all input data, unless there's an exception

This commit is contained in:
Obique PSWG
2016-01-03 02:50:53 -06:00
parent ab2fabfba3
commit ae16190cf0
+3 -1
View File
@@ -125,7 +125,9 @@ public class TCPServer {
SocketChannel sc = sockets.get(sock);
try {
if (sc != null && sc.isConnected()) {
sc.write(ByteBuffer.wrap(data));
ByteBuffer bb = ByteBuffer.wrap(data);
while (bb.hasRemaining())
sc.write(bb);
return true;
}
} catch (IOException e) {