Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Maven:
<dependency>
<groupId>com.arenareturns</groupId>
<artifactId>SimpleNet</artifactId>
<version>1.7.2</version>
<version>1.7.3</version>
</dependency>
```

Gradle:

```groovy
implementation 'com.arenareturns:SimpleNet:1.7.2'
implementation 'com.arenareturns:SimpleNet:1.7.3'
```

2. Because SimpleNet is compiled with Java 11, you must first require its module in your `module-info.java`:
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>com.arenareturns</groupId>
<artifactId>SimpleNet</artifactId>
<version>1.7.2</version>
<version>1.7.3</version>

<name>SimpleNet</name>
<description>ArenaReturns' fork of SimpleNet, an easy-to-use, event-driven, asynchronous network application framework compiled with Java 11.</description>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/arenareturns/simplenet/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import com.arenareturns.simplenet.utility.exposed.data.IntReader;
import com.arenareturns.simplenet.utility.exposed.data.LongReader;
import com.arenareturns.simplenet.utility.exposed.data.StringReader;
import jdk.net.ExtendedSocketOptions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -419,7 +420,10 @@ public final void connect(String address, int port, long timeout, TimeUnit unit,
this.channel = AsynchronousSocketChannel.open(group = AsynchronousChannelGroup.withThreadPool(executor));
this.channel.setOption(StandardSocketOptions.SO_RCVBUF, BUFFER_SIZE);
this.channel.setOption(StandardSocketOptions.SO_SNDBUF, BUFFER_SIZE);
this.channel.setOption(StandardSocketOptions.SO_KEEPALIVE, false);
this.channel.setOption(StandardSocketOptions.SO_KEEPALIVE, true);
this.channel.setOption(ExtendedSocketOptions.TCP_KEEPCOUNT, 3);
this.channel.setOption(ExtendedSocketOptions.TCP_KEEPIDLE, 30);
this.channel.setOption(ExtendedSocketOptions.TCP_KEEPINTERVAL, 5);
this.channel.setOption(StandardSocketOptions.TCP_NODELAY, true);
} catch (IOException e) {
throw new IllegalStateException("Unable to open the channel!", e);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module com.arenareturns.simplenet {
requires org.slf4j;
requires com.arenareturns.pbbl;
requires jdk.net;

exports com.arenareturns.simplenet;
exports com.arenareturns.simplenet.packet;
Expand Down