Skip to content

Commit

Permalink
Try to fix #42
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Apr 23, 2018
1 parent 74f508a commit 4b1ec66
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 7 deletions.
Binary file modified dist/hprose_client_for_java_10.jar
Binary file not shown.
Binary file modified dist/hprose_client_for_java_5.jar
Binary file not shown.
Binary file modified dist/hprose_client_for_java_6.jar
Binary file not shown.
Binary file modified dist/hprose_client_for_java_7.jar
Binary file not shown.
Binary file modified dist/hprose_client_for_java_8.jar
Binary file not shown.
Binary file modified dist/hprose_client_for_java_9.jar
Binary file not shown.
Binary file modified dist/hprose_for_java_10.jar
Binary file not shown.
Binary file modified dist/hprose_for_java_5.jar
Binary file not shown.
Binary file modified dist/hprose_for_java_6.jar
Binary file not shown.
Binary file modified dist/hprose_for_java_7.jar
Binary file not shown.
Binary file modified dist/hprose_for_java_8.jar
Binary file not shown.
Binary file modified dist/hprose_for_java_9.jar
Binary file not shown.
5 changes: 2 additions & 3 deletions src/main/java/hprose/net/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ public final void send() {
return;
}
if (n == 0) {
// key.interestOps(SelectionKey.OP_READ | SelectionKey.OP_WRITE);
timeoutClose();
key.interestOps(SelectionKey.OP_READ | SelectionKey.OP_WRITE);
return;
}
packet.writeLength += n;
Expand All @@ -220,7 +219,7 @@ public final void send() {
}
}
catch (Exception e) {
close();
close(e);
}
}

Expand Down
11 changes: 7 additions & 4 deletions src/main/java/hprose/net/OutPacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ public final class OutPacket {
public final int totalLength;
public int writeLength = 0;
public OutPacket(ByteBuffer buffer, Integer id) {
if (buffer.remaining() == 0) {
buffer.rewind();
}
if (id == null) {
buffers[0] = ByteBuffer.allocate(4);
buffers[0].putInt(buffer.limit());
totalLength = buffer.limit() + 4;
buffers[0].putInt(buffer.remaining());
totalLength = buffer.remaining() + 4;
}
else {
buffers[0] = ByteBuffer.allocate(8);
buffers[0].putInt(buffer.limit() | 0x80000000);
buffers[0].putInt(buffer.remaining() | 0x80000000);
buffers[0].putInt(id);
totalLength = buffer.limit() + 8;
totalLength = buffer.remaining() + 8;
}
buffers[0].flip();
buffers[1] = buffer;
Expand Down

0 comments on commit 4b1ec66

Please sign in to comment.