diff --git a/src/matlab-websocket/pom.xml b/src/matlab-websocket/pom.xml
index 5c2b9ce..26223cc 100644
--- a/src/matlab-websocket/pom.xml
+++ b/src/matlab-websocket/pom.xml
@@ -49,7 +49,7 @@
org.java-websocket
Java-WebSocket
- 1.3.9
+ 1.5.1
diff --git a/src/matlab-websocket/src/main/java/io/github/jebej/matlabwebsocket/MatlabWebSocketServer.java b/src/matlab-websocket/src/main/java/io/github/jebej/matlabwebsocket/MatlabWebSocketServer.java
index 88e610a..8104ddb 100644
--- a/src/matlab-websocket/src/main/java/io/github/jebej/matlabwebsocket/MatlabWebSocketServer.java
+++ b/src/matlab-websocket/src/main/java/io/github/jebej/matlabwebsocket/MatlabWebSocketServer.java
@@ -74,7 +74,7 @@ public void onClose( WebSocket conn, int code, String reason, boolean remote ) {
// Retrieve a connection by hashcode
public WebSocket getConnection( int hashCode ) {
- Collection conns = connections();
+ Collection conns = getConnections();
synchronized ( conns ) {
for( WebSocket c : conns ) {
if (c.hashCode() == hashCode) {
@@ -102,7 +102,7 @@ public void sendTo( int hashCode, byte[] bytes ) {
// Send text message to all clients
public void sendToAll( String message ) {
- Collection conns = connections();
+ Collection conns = getConnections();
synchronized ( conns ) {
for( WebSocket c : conns ) {
c.send( message );
@@ -112,7 +112,7 @@ public void sendToAll( String message ) {
// Send binary message to all clients
public void sendToAll( ByteBuffer blob ) {
- Collection conns = connections();
+ Collection conns = getConnections();
synchronized ( conns ) {
for( WebSocket c : conns ) {
c.send( blob );
@@ -132,7 +132,7 @@ public void close( int hashCode ) {
// Close all connections
public void closeAll() {
- Collection conns = connections();
+ Collection conns = getConnections();
synchronized ( conns ) {
for( WebSocket c : conns ) {
c.close();