diff --git a/pom.xml b/pom.xml
index 4c27a824..86c9882f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,7 +65,7 @@
io.netty
netty-all
- 5.0.0.Alpha2
+ 4.1.4.Final
@@ -76,20 +76,21 @@
org.apache.maven.plugins
maven-compiler-plugin
- 2.5.1
+ 3.6.1
-
- 1.7
+
+ 1.7
org.apache.maven.plugins
maven-jar-plugin
- 2.6
+ 3.0.2
org.apache.maven.plugins
- maven-source-plugin
+ maven-source-plugin
+ 3.0.1
attach-sources
@@ -100,8 +101,9 @@
- org.apache.maven.plugins
- maven-javadoc-plugin
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 2.10.4
attach-javadocs
@@ -114,7 +116,7 @@
org.apache.maven.plugins
maven-shade-plugin
- 2.4.1
+ 2.4.3
package
diff --git a/src/main/java/org/spacehq/packetlib/Server.java b/src/main/java/org/spacehq/packetlib/Server.java
index ff27f752..5300739c 100644
--- a/src/main/java/org/spacehq/packetlib/Server.java
+++ b/src/main/java/org/spacehq/packetlib/Server.java
@@ -242,7 +242,7 @@ public class Server {
* @return Whether the server is listening.
*/
public boolean isListening() {
- return this.listener.isListening();
+ return this.listener != null && this.listener.isListening();
}
/**
diff --git a/src/main/java/org/spacehq/packetlib/Session.java b/src/main/java/org/spacehq/packetlib/Session.java
index f2981f65..acf7a43c 100644
--- a/src/main/java/org/spacehq/packetlib/Session.java
+++ b/src/main/java/org/spacehq/packetlib/Session.java
@@ -5,7 +5,6 @@ import org.spacehq.packetlib.event.session.SessionListener;
import org.spacehq.packetlib.packet.Packet;
import org.spacehq.packetlib.packet.PacketProtocol;
-import java.net.InetAddress;
import java.net.SocketAddress;
import java.util.List;
import java.util.Map;
diff --git a/src/main/java/org/spacehq/packetlib/tcp/TcpSession.java b/src/main/java/org/spacehq/packetlib/tcp/TcpSession.java
index 5c119890..5773b29d 100644
--- a/src/main/java/org/spacehq/packetlib/tcp/TcpSession.java
+++ b/src/main/java/org/spacehq/packetlib/tcp/TcpSession.java
@@ -22,7 +22,6 @@ import org.spacehq.packetlib.packet.Packet;
import org.spacehq.packetlib.packet.PacketProtocol;
import java.net.ConnectException;
-import java.net.InetAddress;
import java.net.SocketAddress;
import java.util.ArrayList;
import java.util.HashMap;
@@ -371,7 +370,7 @@ public abstract class TcpSession extends SimpleChannelInboundHandler imp
}
@Override
- protected void messageReceived(ChannelHandlerContext ctx, Packet packet) throws Exception {
+ protected void channelRead0(ChannelHandlerContext ctx, Packet packet) throws Exception {
if(!packet.isPriority()) {
this.packets.add(packet);
}