Skip to content

Commit e995b23

Browse files
committed
Updated Java-Websocket to 1.3.6 to support receiving fragments with the onMessage method
1 parent abfa30d commit e995b23

File tree

6 files changed

+16
-9
lines changed

6 files changed

+16
-9
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ When you are done, do not forget to `delete` the clients and/or servers.
4747
See the `EchoServer.m` and `SimpleClient.m` files in the `examples` folder for an implementation example. A good resource on classes is the [MATLAB object-oriented documentation](http://www.mathworks.com/help/matlab/object-oriented-programming.html).
4848

4949
Example
50-
------
50+
------------
5151
The example is an echo server, it returns to the client whatever was received.
5252

5353
Run the echo server by making sure that the file is on the MATLAB path and executing
@@ -91,7 +91,7 @@ clear server;
9191
```
9292

9393
SSL / WebSocket Secure (wss)
94-
-------
94+
------------
9595

9696
To enable SSL, you must first have a certificate. A self-signed key store can be generated with the java `keytool`, but you should always use a valid certificate in production. From there, open the server by passing the location of the store, the store password, and the key password. With the EchoServer, for example:
9797

@@ -119,14 +119,21 @@ Message received:
119119
hi, this communication is secured!
120120
```
121121

122+
Building the Java JAR
123+
------------
124+
125+
To build the `jar` file yourself, it is recommended to use Apache Maven. Maven will automatically take care of downloading Java-WebSocket and neatly package everything into a single file (an "uber jar").
126+
127+
Once the `mvn` command is on your path, simply `cd` to the `matlab-websocket` folder and execute `mvn package`.
128+
122129
Acknowledgments
123-
-------
130+
------------
124131

125132
This work was inspired by a websocket client MATLAB implementation: [matlab-websockets](https://github.com/mingot/matlab-websockets).
126133

127134
It relies on the [Java-WebSocket](https://github.com/TooTallNate/Java-WebSocket) library.
128135

129136
License
130-
-------
137+
------------
131138

132139
The code in this repository is licensed under the MIT license. See the `LICENSE` file for details.

jar/matlab-websocket-1.3.jar

-122 KB
Binary file not shown.

jar/matlab-websocket-1.4.jar

117 KB
Binary file not shown.

src/matlab-websocket/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>io.github.jebej.matlabwebsocket</groupId>
66
<artifactId>matlab-websocket</artifactId>
77
<packaging>jar</packaging>
8-
<version>1.3</version>
8+
<version>1.4</version>
99

1010
<name>matlab-websocket</name>
1111
<url>http://maven.apache.org</url>
@@ -51,7 +51,7 @@
5151
<dependency>
5252
<groupId>org.java-websocket</groupId>
5353
<artifactId>Java-WebSocket</artifactId>
54-
<version>1.3.4</version>
54+
<version>1.3.6</version>
5555
</dependency>
5656
</dependencies>
5757
</project>

src/matlab-websocket/src/main/java/io/github/jebej/matlabwebsocket/MatlabWebSocketClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void onMessage( String message ) {
3333
}
3434
}
3535

36-
// Method handler when a byte message has been received from the client
36+
// Method handler when a byte message has been received by the client
3737
@Override
3838
public void onMessage( ByteBuffer blob ) {
3939
MatlabEvent matlab_event = new MatlabEvent( this, blob );

src/matlab-websocket/src/main/java/io/github/jebej/matlabwebsocket/MatlabWebSocketServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void onOpen( WebSocket conn, ClientHandshake handshake ) {
3434
}
3535
}
3636

37-
// Method handler when a text message has been received from the client
37+
// Method handler when a text message has been received by the server
3838
@Override
3939
public void onMessage( WebSocket conn, String message ) {
4040
MatlabEvent matlab_event = new MatlabEvent( this, conn, message );
@@ -43,7 +43,7 @@ public void onMessage( WebSocket conn, String message ) {
4343
}
4444
}
4545

46-
// Method handler when a binary message has been received from the client
46+
// Method handler when a binary message has been received by the server
4747
@Override
4848
public void onMessage( WebSocket conn, ByteBuffer blob ) {
4949
MatlabEvent matlab_event = new MatlabEvent( this, conn, blob );

0 commit comments

Comments
 (0)