Skip to content

Commit 2cc3446

Browse files
committed
refactor(channel): Simply how packets are handled
fix(packet): Fix misreporting of packet sizes in one of the write functions
1 parent 0869d28 commit 2cc3446

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1745
-2134
lines changed

.github/workflows/maven-publish.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
18-
- name: Set up JDK 1.8
19-
uses: actions/setup-java@v1
17+
- uses: actions/checkout@v4
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
2020
with:
21-
java-version: 1.8
21+
distribution: 'temurin'
22+
java-version: 17
2223
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
2324
settings-path: ${{ github.workspace }} # location for the settings.xml file
2425

.github/workflows/maven-test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
19-
- name: Set up JDK 1.8
20-
uses: actions/setup-java@v1
18+
- uses: actions/checkout@v4
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
2121
with:
22-
java-version: 1.8
22+
distribution: 'temurin'
23+
java-version: 17
2324
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
2425
settings-path: ${{ github.workspace }} # location for the settings.xml file
2526

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ public class Main
2323
CoolSocket coolSocket = new CoolSocket(port)
2424
{
2525
@Override
26-
public void onConnected(ActiveConnection activeConnection)
26+
public void onConnected(ActiveConnection channel)
2727
{
2828
try {
29-
activeConnection.reply("Hello!");
30-
System.out.println(activeConnection.receive().getAsString()); // Merhaba!
29+
channel.reply("Hello!");
30+
System.out.println(channel.receive().getAsString()); // Merhaba!
3131
} catch (IOException e) {
3232
e.printStackTrace();
3333
}
@@ -36,9 +36,9 @@ public class Main
3636

3737
coolSocket.start();
3838

39-
try (ActiveConnection activeConnection = ActiveConnection.connect(new InetSocketAddress(port), 0)) {
40-
System.out.println(activeConnection.receive().getAsString()); // "Hello!"
41-
activeConnection.reply("Merhaba!");
39+
try (ActiveConnection channel = ActiveConnection.connect(new InetSocketAddress(port), 0)) {
40+
System.out.println(channel.receive().getAsString()); // "Hello!"
41+
channel.reply("Merhaba!");
4242
} finally {
4343
coolSocket.stop();
4444
}

pom.xml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<url>https://github.com/libcoolsocket/java</url>
3131
</scm>
3232
<properties>
33-
<maven.compiler.source>1.8</maven.compiler.source>
34-
<maven.compiler.target>1.8</maven.compiler.target>
33+
<maven.compiler.source>17</maven.compiler.source>
34+
<maven.compiler.target>17</maven.compiler.target>
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3636
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
3737
</properties>
@@ -40,7 +40,7 @@
4040
<plugin>
4141
<groupId>org.apache.maven.plugins</groupId>
4242
<artifactId>maven-jar-plugin</artifactId>
43-
<version>3.2.0</version>
43+
<version>3.4.2</version>
4444
<executions>
4545
<execution>
4646
<goals>
@@ -52,18 +52,18 @@
5252
<plugin>
5353
<groupId>org.apache.maven.plugins</groupId>
5454
<artifactId>maven-compiler-plugin</artifactId>
55-
<version>3.8.1</version>
55+
<version>3.13.0</version>
5656
<configuration>
57-
<source>1.8</source>
58-
<target>1.8</target>
57+
<source>17</source>
58+
<target>17</target>
5959
</configuration>
6060
</plugin>
6161
<plugin>
6262
<groupId>org.apache.maven.plugins</groupId>
6363
<artifactId>maven-javadoc-plugin</artifactId>
64-
<version>3.1.1</version>
64+
<version>3.8.0</version>
6565
<configuration>
66-
<source>8</source>
66+
<source>17</source>
6767
<show>private</show>
6868
<nohelp>true</nohelp>
6969
<javadocExecutable>/usr/bin/javadoc</javadocExecutable>
@@ -80,7 +80,7 @@
8080
<plugin>
8181
<groupId>org.apache.maven.plugins</groupId>
8282
<artifactId>maven-source-plugin</artifactId>
83-
<version>3.0.1</version>
83+
<version>3.3.1</version>
8484
<executions>
8585
<execution>
8686
<id>attach-sources</id>
@@ -93,7 +93,7 @@
9393
<plugin>
9494
<groupId>org.apache.maven.plugins</groupId>
9595
<artifactId>maven-release-plugin</artifactId>
96-
<version>2.5.2</version>
96+
<version>3.1.1</version>
9797
<configuration>
9898
<releaseProfiles>release</releaseProfiles>
9999
</configuration>
@@ -121,7 +121,7 @@
121121
<plugin>
122122
<groupId>org.apache.maven.plugins</groupId>
123123
<artifactId>maven-gpg-plugin</artifactId>
124-
<version>1.6</version>
124+
<version>3.2.3</version>
125125
<executions>
126126
<execution>
127127
<id>sign-artifacts</id>
@@ -135,7 +135,7 @@
135135
<plugin>
136136
<groupId>org.sonatype.plugins</groupId>
137137
<artifactId>nexus-staging-maven-plugin</artifactId>
138-
<version>1.6.7</version>
138+
<version>1.7.0</version>
139139
<extensions>true</extensions>
140140
<configuration>
141141
<serverId>ossrh</serverId>
@@ -157,11 +157,6 @@
157157
</profile>
158158
</profiles>
159159
<dependencies>
160-
<dependency>
161-
<groupId>org.json</groupId>
162-
<artifactId>json</artifactId>
163-
<version>20230618</version>
164-
</dependency>
165160
<dependency>
166161
<groupId>junit</groupId>
167162
<artifactId>junit</artifactId>

0 commit comments

Comments
 (0)