Skip to content

Commit

Permalink
Merge pull request #25 from tlf30/24-release-0.1.0
Browse files Browse the repository at this point in the history
Release v0.1.0
  • Loading branch information
tlf30 authored Jan 22, 2021
2 parents a15aa11 + 9cd00c1 commit 1cbbba0
Show file tree
Hide file tree
Showing 8 changed files with 345 additions and 30 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#### v0.1.0
SSL Support for TCP channel
* SSL Support for TCP channel (#5, #6)
* Optimize network message transport (#4, #11)
* Better logging and enhanced test examples (#9)
* Better error reporting on non-serializable objects in a message (#14, #16)
* Separation of examples and library, and corresponding dependencies (#22)
* Fixed issue where messages would be transferred before connection listeners were notified (#20, #21)
* Fixed issue where dropped sockets would not be detected (#10, #23)

#### V0.0.0
Initial Release
56 changes: 54 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,56 @@
# monkey-netty
![Build](https://github.com/tlf30/monkey-netty/workflows/Java%20CI%20with%20Gradle/badge.svg)
An implementation of a server-client communication system for jMonkeyEngine using Netty.IO that utilizes both TCP and UDP communication.
See example for server and client in `examples` module
An implementation of a server-client communication system for jMonkeyEngine using Netty.IO that utilizes both TCP and UDP communication.

**Checkout our [Wiki](https://github.com/tlf30/monkey-netty/wiki) for getting started.**

**See example for server and client in `examples` module.**

## Installing with Gradle
In your `build.gradle` you will need to:

1. Include the github repo:
```groovy
repositories {
...
maven {
url = 'https://maven.pkg.github.com/tlf30/monkey-netty'
}
}
```

2. Specify the dependency:
```groovy
dependencies {
...
implementation 'io.tlf.monkeynetty:monkey-netty:0.1.0'
}
```

## Installing with Maven
In your pom.xml you will need to:

1. Include the github repo:
```xml
<repositories>
...
<repository>
<id>monkey-netty</id>
<name>Monkey-Netty GitHub Packages</name>
<url>https://maven.pkg.github.com/tlf30/monkey-netty</url>
</repository>
</repositories>
```

2. Specify the dependency:
```xml
<dependencies>
...
<dependency>
<groupId>io.tlf.monkeynetty</groupId>
<artifactId>monkey-netty</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
```

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
allprojects {
version = '0.1.0-SNAPSHOT'
version = '0.1.0'
group = "io.tlf.monkeynetty"

ext {
Expand Down
6 changes: 4 additions & 2 deletions examples/src/main/java/io/tlf/monkeynetty/test/JmeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ of this software and associated documentation files (the "Software"), to deal

package io.tlf.monkeynetty.test;

import io.netty.handler.logging.LogLevel;
import io.tlf.monkeynetty.ConnectionListener;
import io.tlf.monkeynetty.test.messages.TestUDPBigMessageA;
import io.tlf.monkeynetty.test.messages.TestTCPBigMessageA;
Expand All @@ -50,8 +51,9 @@ public class JmeClient extends SimpleApplication {

@Override
public void simpleInitApp() {
client = new NettyClient("test", true, 10000, "localhost");
client = new NettyClient("test", true, 10000, "localhost");
stateManager.attach(client);
client.setLogLevel(LogLevel.INFO);
client.registerListener(new MessageListener() {
@Override
public void onMessage(NetworkMessage msg, NetworkServer server, NetworkClient client) {
Expand All @@ -60,7 +62,7 @@ public void onMessage(NetworkMessage msg, NetworkServer server, NetworkClient cl

@Override
public Class<? extends NetworkMessage>[] getSupportedMessages() {
return new Class[] {TestTCPMessage.class, TestUDPMessage.class, TestTCPBigMessageA.class, TestTCPBigMessageB.class, TestUDPBigMessageA.class, TestUDPBigMessageB.class};
return new Class[]{TestTCPMessage.class, TestUDPMessage.class, TestTCPBigMessageA.class, TestTCPBigMessageB.class, TestUDPBigMessageA.class, TestUDPBigMessageB.class};
}
});

Expand Down
28 changes: 28 additions & 0 deletions monkey-netty/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ plugins {
id 'maven-publish'
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
repositories {
maven {
Expand All @@ -17,6 +22,29 @@ publishing {
publications {
gpr(MavenPublication) {
from(components.java)
pom {
name = 'Monkey Netty'
description = 'A implementation of a server-client communication system for jMonkeyEngine using Netty.IO that utilizes both TCP and UDP communication.'
url = 'https://github.com/tlf30/monkey-netty'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'tlf30'
name = 'Trevor Flynn'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/tlf30/monkey-netty.git'
developerConnection = 'scm:git:ssh://tlf30/monkey-netty.git'
url = 'https://github.com/tlf30/monkey-netty/'
}
}
}
}
}
Expand Down
29 changes: 29 additions & 0 deletions monkey-netty/src/main/java/io/tlf/monkeynetty/NetworkServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,35 @@ public interface NetworkServer {
*/
public NetworkProtocol[] getProtocol();

/**
* @return true if the server is currently blocking new connections
*/
public boolean isBlocking();

/**
* Set if the server should block incoming connections. If true
* the server will close all incoming connections immediately without
* performing a handshake after establishing the connection.
*
* @param blocking If the server should block incoming connections.
*/
public void setBlocking(boolean blocking);

/**
* @return The maximum number of connections the server will allow.
*/
public int getMaxConnections();

/**
* This sets the maximum number of connections the server will be allowed to have at any given time.
* If a connection is attempted to the server and the server currently has the maximum number of
* connections, it will immediately close the connection without performing a handshake after establishing
* the connection.
*
* @param maxConnections The maximum number of connections the server will allow.
*/
public void setMaxConnections(int maxConnections);

/**
* Send a message to all clients connected to the server.
*
Expand Down
Loading

0 comments on commit 1cbbba0

Please sign in to comment.