Skip to content

Commit

Permalink
Improved code
Browse files Browse the repository at this point in the history
  • Loading branch information
szhnet committed Sep 27, 2021
1 parent ed6addc commit ac250d8
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To add a dependency using Maven:
<dependency>
<groupId>io.jpower.kcp</groupId>
<artifactId>kcp-netty</artifactId>
<version>1.4.11</version>
<version>1.4.12</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion kcp-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.jpower.kcp</groupId>
<artifactId>kcp-parent</artifactId>
<version>1.4.11</version>
<version>1.4.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kcp-netty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.jpower.kcp</groupId>
<artifactId>kcp-parent</artifactId>
<version>1.4.11</version>
<version>1.4.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
1 change: 1 addition & 0 deletions kcp-netty/src/main/java/io/jpower/kcp/netty/Kcp.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ private void release(List<Segment> segQueue) {
for (Segment seg : segQueue) {
seg.recycle(true);
}
segQueue.clear();
}

private ByteBuf tryCreateOrOutput(ByteBuf buffer, int need) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ public UkcpClientChannel conv(int conv) {
return this;
}

public boolean kcpIsActive() {
return ukcp.isActive();
}

void kcpReceive(ByteBuf buf) throws IOException {
ukcp.receive(buf);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void read() {
exception1 = t;
}

if (exception1 == null) {
if (exception1 == null && ukcpChannel.kcpIsActive()) {
boolean mergeSegmentBuf = ukcpChannel.config().isMergeSegmentBuf();
CodecOutputList<ByteBuf> recvBufList = null;
boolean recv = false;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.jpower.kcp</groupId>
<artifactId>kcp-parent</artifactId>
<version>1.4.11</version>
<version>1.4.12</version>
<packaging>pom</packaging>

<name>kcp-netty [Parent]</name>
Expand Down

0 comments on commit ac250d8

Please sign in to comment.