Skip to content

Commit b7f8eeb

Browse files
committed
update to patch version v1.1.2
add perform async send methode
1 parent d24aab6 commit b7f8eeb

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<a href="https://zyonicsoftware.com"> <img src="https://i.postimg.cc/HnjVQNdQ/signal.png" /></a>
33
<h2>A library for java with the native java socket technology and in combination with the custom bytebuffer allocator technology by boonproject</h2>
44
<hr />
5-
<a href="https://gitlab.zyonicsoftware.com/mint9976/Signal/-/packages"><img src="https://img.shields.io/badge/release-v1.1.0-9cf" /></a>
5+
<a href="https://gitlab.zyonicsoftware.com/mint9976/Signal/-/packages"><img src="https://img.shields.io/badge/release-v1.1.2-9cf" /></a>
66
<a href="https://github.com/mintUI9976/Signal"><img src="https://img.shields.io/github/languages/code-size/mintUI9976/Signal?color=orange" /></a>
77
<a href="https://github.com/mintUI9976/Signal"><img src="https://img.shields.io/tokei/lines/github/mintUI9976/Signal?color=yellow" /></a>
88
<a href="https://github.com/mintUI9976/Signal/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mintUI9976/Signal" /></a>
@@ -62,7 +62,7 @@ maven{url"https://gitlab.zyonicsoftware.com/api/v4/projects/144/packages/maven"}
6262
````
6363

6464
````xml
65-
compile group:'com.zyonicsoftware.minereaper.signal',name:'Signal',version:'v1.1.0'
65+
compile group:'com.zyonicsoftware.minereaper.signal',name:'Signal',version:'v1.1.2'
6666
````
6767

6868
<hr />
@@ -74,12 +74,12 @@ compile group:'com.zyonicsoftware.minereaper.signal',name:'Signal',version:'v1.1
7474
<dependency>
7575
<groupId>com.zyonicsoftware.minereaper.signal</groupId>
7676
<artifactId>Signal</artifactId>
77-
<version>v1.1.0</version>
77+
<version>v1.1.2</version>
7878
</dependency>
7979
````
8080

8181
````xml
82-
mvn dependency:get -Dartifact=com.zyonicsoftware.minereaper.signal:Signal:v1.1.0
82+
mvn dependency:get -Dartifact=com.zyonicsoftware.minereaper.signal:Signal:v1.1.2
8383
````
8484

8585
````xml

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
apply plugin: 'maven'
88

99
group 'com.zyonicsoftware.minereaper.signal'
10-
version 'v1.1.0'
10+
version 'v1.1.2'
1111

1212
tasks.withType(JavaCompile) {
1313
options.encoding = 'UTF-8'

src/main/java/com/zyonicsoftware/minereaper/signal/client/Client.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import com.zyonicsoftware.minereaper.enums.EugeneFactoryPriority;
1313
import com.zyonicsoftware.minereaper.redeugene.RedEugene;
14+
import com.zyonicsoftware.minereaper.scheduler.RedEugeneIntroduction;
1415
import com.zyonicsoftware.minereaper.signal.allocator.Allocation;
1516
import com.zyonicsoftware.minereaper.signal.allocator.Allocator;
1617
import com.zyonicsoftware.minereaper.signal.caller.SignalCallRegistry;
@@ -44,6 +45,7 @@ public class Client extends Connection {
4445
private long incomingPackets;
4546
private long outgoingPackets;
4647
private boolean disconnected;
48+
private boolean performSendAsync;
4749

4850
public long getIncomingPackets() {
4951
return this.incomingPackets;
@@ -93,13 +95,15 @@ public Client(
9395
final int port,
9496
@NotNull final Class<? extends SignalCaller> signalCaller,
9597
final long scheduleDelay,
98+
final boolean performSendAsync,
9699
final int timeout) {
97100
this.hostname = hostname;
98101
this.port = port;
99102
RedEugeneScheduler.setRedEugene(
100103
new RedEugene("SignalClientPool", 3, false, EugeneFactoryPriority.NORM));
101104
SignalCallRegistry.registerReferenceCaller(signalCaller);
102105
this.scheduleDelay = scheduleDelay;
106+
this.performSendAsync = performSendAsync;
103107
this.timeout = timeout;
104108
this.disconnected = false;
105109
Allocator.setAllocation(Allocation.CLIENT_SIDE);
@@ -126,12 +130,14 @@ public Client(
126130
@NotNull final Class<? extends SignalCaller> signalCaller,
127131
final RedEugene redEugene,
128132
final long scheduleDelay,
133+
final boolean performSendAsync,
129134
final int timeout) {
130135
this.hostname = hostname;
131136
this.port = port;
132137
RedEugeneScheduler.setRedEugene(redEugene);
133138
SignalCallRegistry.registerReferenceCaller(signalCaller);
134139
this.scheduleDelay = scheduleDelay;
140+
this.performSendAsync = performSendAsync;
135141
this.timeout = timeout;
136142
this.disconnected = false;
137143
Allocator.setAllocation(Allocation.CLIENT_SIDE);
@@ -241,6 +247,10 @@ public boolean isDisconnected() {
241247

242248
/** @param packet adds the packet to list */
243249
public void send(final Packet packet) {
244-
this.outputStreamThread.send(packet);
250+
if (!this.performSendAsync){
251+
this.outputStreamThread.send(packet);
252+
} else {
253+
RedEugeneScheduler.getRedEugene().getRedThreadPool().execute(() -> outputStreamThread.send(packet));
254+
}
245255
}
246256
}

src/main/java/com/zyonicsoftware/minereaper/signal/example/ExampleClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static void registerPackets() {
5050
*/
5151
private static void executeClient() throws IOException {
5252
ExampleClient.client =
53-
new Client("localhost", 9976, ExampleSignalMessageInstance.class, 60, 20 * 1000);
53+
new Client("localhost", 9976, ExampleSignalMessageInstance.class, 60, true,20 * 1000);
5454
ExampleClient.client.connect();
5555
System.out.println("Client has been connect on port: " + ExampleClient.client.getPort());
5656
}

0 commit comments

Comments
 (0)