Skip to content

Commit a14541f

Browse files
authored
Merge pull request #498 from marci4/master
Update to 1.3.4
2 parents fed2f7e + ae3c088 commit a14541f

File tree

10 files changed

+84
-76
lines changed

10 files changed

+84
-76
lines changed

README.markdown

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Java WebSockets
22
===============
3-
[![Build Status](https://travis-ci.org/marci4/Java-WebSocket-Dev.svg?branch=master)](https://travis-ci.org/marci4/Java-WebSocket-Dev) [![Clojars Project](https://img.shields.io/clojars/v/org.java-websocket/java-websocket.svg)](https://clojars.org/org.java-websocket/java-websocket)
4-
3+
[![Build Status](https://travis-ci.org/marci4/Java-WebSocket-Dev.svg?branch=master)](https://travis-ci.org/marci4/Java-WebSocket-Dev)
4+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.java-websocket/Java-WebSocket/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.java-websocket/Java-WebSocket)
55

66
This repository contains a barebones WebSocket server and client implementation
77
written in 100% Java. The underlying classes are implemented `java.nio`, which allows for a
@@ -36,37 +36,30 @@ will create the javadoc of this library at ```doc/``` and build the library itse
3636
The ant targets are: ```compile```, ```jar```, ```doc``` and ```clean```
3737

3838
### Maven
39-
To use maven add this repository to your pom.xml:
40-
```xml
41-
<repository>
42-
<id>clojars.org</id>
43-
<url>http://clojars.org/repo</url>
44-
</repository>
45-
```
46-
Also add this dependency to your pom.xml:
39+
To use maven add this dependency to your pom.xml:
4740
```xml
4841
<dependency>
4942
<groupId>org.java-websocket</groupId>
50-
<artifactId>java-websocket</artifactId>
51-
<version>1.3.3</version>
43+
<artifactId>Java-WebSocket</artifactId>
44+
<version>1.3.4</version>
5245
</dependency>
5346
```
5447

5548
### Gradle
56-
To use Gradle add this repository to your repositories list :
49+
To use Gradle add the maven central repository to your repositories list :
5750
```xml
58-
maven { url "http://clojars.org/repo" }
51+
mavenCentral()
5952
```
6053
Then you can just add the latest version to your build.
6154
```xml
62-
compile "org.java-websocket:java-websocket:1.3.3"
55+
compile "org.java-websocket:Java-WebSocket:1.3.4"
6356
```
6457

6558

6659
### Leiningen
6760

6861
``` bash
69-
[org.java-websocket/java-websocket "1.3.3"]
62+
[org.java-websocket/java-websocket "1.3.4"]
7063
```
7164

7265
Running the Examples

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repositories {
99
}
1010

1111
group = 'org.java_websocket'
12-
version = '1.3.3'
12+
version = '1.3.4'
1313
sourceCompatibility = 1.6
1414
targetCompatibility = 1.6
1515

pom.xml

Lines changed: 58 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>org.java-websocket</groupId>
4-
<artifactId>java-websocket</artifactId>
4+
<artifactId>Java-WebSocket</artifactId>
55
<packaging>jar</packaging>
6-
<version>1.3.3</version>
7-
<name>java-websocket</name>
6+
<version>1.3.4</version>
7+
<name>Java-WebSocket</name>
88
<description>A barebones WebSocket client and server implementation written 100% in Java</description>
99
<url>https://github.com/TooTallNate/Java-WebSocket</url>
1010
<licenses>
@@ -16,60 +16,68 @@
1616
<scm>
1717
<url>https://github.com/TooTallNate/Java-WebSocket</url>
1818
</scm>
19+
<distributionManagement>
20+
<snapshotRepository>
21+
<id>ossrh</id>
22+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
23+
</snapshotRepository>
24+
</distributionManagement>
1925
<build>
20-
<sourceDirectory>src\main\java</sourceDirectory>
21-
<testSourceDirectory>test</testSourceDirectory>
22-
<resources>
23-
<resource>
24-
<directory>resources</directory>
25-
</resource>
26-
</resources>
27-
<testResources>
28-
<testResource>
29-
<directory>resources</directory>
30-
</testResource>
31-
</testResources>
32-
<directory>target</directory>
33-
<outputDirectory>target\classes</outputDirectory>
34-
<plugins/>
26+
<sourceDirectory>src/main/java</sourceDirectory>
27+
<plugins>
28+
<plugin>
29+
<groupId>org.sonatype.plugins</groupId>
30+
<artifactId>nexus-staging-maven-plugin</artifactId>
31+
<version>1.6.7</version>
32+
<extensions>true</extensions>
33+
<configuration>
34+
<serverId>ossrh</serverId>
35+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
36+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
37+
</configuration>
38+
</plugin>
39+
<plugin>
40+
<groupId>org.apache.maven.plugins</groupId>
41+
<artifactId>maven-source-plugin</artifactId>
42+
<version>2.2.1</version>
43+
<executions>
44+
<execution>
45+
<id>attach-sources</id>
46+
<goals>
47+
<goal>jar-no-fork</goal>
48+
</goals>
49+
</execution>
50+
</executions>
51+
</plugin>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-javadoc-plugin</artifactId>
55+
<version>2.9.1</version>
56+
<executions>
57+
<execution>
58+
<id>attach-javadocs</id>
59+
<goals>
60+
<goal>jar</goal>
61+
</goals>
62+
</execution>
63+
</executions>
64+
</plugin>
65+
</plugins>
3566
</build>
36-
<repositories>
37-
<repository>
38-
<id>central</id>
39-
<url>https://repo1.maven.org/maven2/</url>
40-
<snapshots>
41-
<enabled>false</enabled>
42-
</snapshots>
43-
<releases>
44-
<enabled>true</enabled>
45-
</releases>
46-
</repository>
47-
<repository>
48-
<id>clojars</id>
49-
<url>https://clojars.org/repo/</url>
50-
<snapshots>
51-
<enabled>true</enabled>
52-
</snapshots>
53-
<releases>
54-
<enabled>true</enabled>
55-
</releases>
56-
</repository>
57-
</repositories>
58-
<dependencyManagement>
59-
<dependencies/>
60-
</dependencyManagement>
61-
<dependencies/>
67+
<dependencies>
68+
<dependency>
69+
<groupId>junit</groupId>
70+
<artifactId>junit</artifactId>
71+
<version>4.11</version>
72+
<scope>test</scope>
73+
</dependency>
74+
</dependencies>
6275
<developers>
6376
<developer>
6477
<name>Nathan Rajlich</name>
6578
<url>https://github.com/TooTallNate</url>
6679
<email>[email protected]</email>
6780
</developer>
68-
<developer>
69-
<name>David Rohmer</name>
70-
<url>https://github.com/Davidiusdadi</url>
71-
<email>[email protected]</email>
72-
</developer>
7381
<developer>
7482
<name>Marcel Prestel</name>
7583
<url>https://github.com/marci4</url>
@@ -78,7 +86,4 @@
7886
</developers>
7987
</project>
8088

81-
<!-- This file was autogenerated by Leiningen.
82-
Please do not edit it directly; instead edit project.clj and regenerate it.
83-
It should not be considered canonical data. For more information see
84-
https://github.com/technomancy/leiningen -->
89+

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject org.java-websocket/java-websocket "1.3.3"
1+
(defproject org.java-websocket/java-websocket "1.3.4"
22
:description "A barebones WebSocket client and server implementation written 100% in Java"
33
:url "https://github.com/TooTallNate/Java-WebSocket"
44
:scm {:name "git"

src/main/java/org/java_websocket/AbstractWebSocket.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public int getConnectionLostTimeout() {
4242

4343
/**
4444
* Setter for the interval checking for lost connections
45-
* A value >= 0 results in the check to be deactivated
45+
* A value lower or equal 0 results in the check to be deactivated
4646
*
4747
* @param connectionLostTimeout the interval in seconds
4848
*/

src/main/java/org/java_websocket/SSLSocketChannel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
/**
2020
* A class that represents an SSL/TLS peer, and can be extended to create a client or a server.
21-
* <p/>
21+
*
2222
* It makes use of the JSSE framework, and specifically the {@link SSLEngine} logic, which
2323
* is described by Oracle as "an advanced API, not appropriate for casual use", since
2424
* it requires the user to implement much of the communication establishment procedure himself.
2525
* More information about it can be found here: http://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLEngine
26-
* <p/>
26+
*
2727
* {@link SSLSocketChannel} implements the handshake protocol, required to establish a connection between two peers,
2828
* which is common for both client and server and provides the abstract {@link SSLSocketChannel#read(ByteBuffer)} and
2929
* {@link SSLSocketChannel#write(ByteBuffer)} (String)} methods, that need to be implemented by the specific SSL/TLS peer

src/main/java/org/java_websocket/framing/CloseFrame.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ public CloseFrame() {
133133
setCode(CloseFrame.NORMAL);
134134
}
135135

136-
public void setCode(int code) {
136+
/**
137+
* Set the close code for this close frame
138+
* @param code the close code
139+
*/
140+
public void setCode(int code) {
137141
this.code = code;
138142
// CloseFrame.TLS_ERROR is not allowed to be transfered over the wire
139143
if (code == CloseFrame.TLS_ERROR) {
@@ -143,6 +147,10 @@ public void setCode(int code) {
143147
updatePayload();
144148
}
145149

150+
/**
151+
* Set the close reason for this close frame
152+
* @param reason the reason code
153+
*/
146154
public void setReason(String reason) {
147155
if (reason == null) {
148156
reason = "";

src/main/java/org/java_websocket/framing/ControlFrame.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public abstract class ControlFrame extends FramedataImpl1 {
1010

1111
/**
1212
* Class to represent a control frame
13+
* @param opcode the opcode to use
1314
*/
1415
public ControlFrame( Opcode opcode ) {
1516
super( opcode );

src/main/java/org/java_websocket/framing/DataFrame.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public abstract class DataFrame extends FramedataImpl1 {
99

1010
/**
1111
* Class to represent a data frame
12+
* @param opcode the opcode to use
1213
*/
1314
public DataFrame(Opcode opcode) {
1415
super(opcode);

src/main/java/org/java_websocket/framing/FramedataImpl1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public abstract class FramedataImpl1 implements Framedata {
4646
/**
4747
* Check if the frame is valid due to specification
4848
*
49-
* @throws InvalidDataException
49+
* @throws InvalidDataException thrown if the frame is not a valid frame
5050
*/
5151
public abstract void isValid() throws InvalidDataException;
5252

0 commit comments

Comments
 (0)