Skip to content

Commit 35d0216

Browse files
committed
Merge branch 'leancloud' into merge_from_leancloud
2 parents 0033180 + e623981 commit 35d0216

56 files changed

Lines changed: 650 additions & 733 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ repositories {
88
mavenCentral()
99
}
1010

11-
group = 'org.java_websocket'
12-
version = '1.2.1-SNAPSHOT'
11+
group = 'cn.leancloud.android'
12+
version = '1.3.1-SNAPSHOT'
1313
sourceCompatibility = 1.6
1414
targetCompatibility = 1.6
1515

@@ -19,7 +19,7 @@ configurations {
1919

2020
configure(install.repositories.mavenInstaller) {
2121
pom.version = project.version
22-
pom.groupId = "org.java_websocket"
22+
pom.groupId = "cn.leancloud.android"
2323
pom.artifactId = 'Java-WebSocket'
2424
}
2525

pom.xml

Lines changed: 51 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<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">
3-
<parent>
4-
<groupId>org.sonatype.oss</groupId>
5-
<artifactId>oss-parent</artifactId>
6-
<version>7</version>
7-
</parent>
8-
<scm>
9-
<connection>scm:git:git@github.com:TooTallNate/Java-WebSocket.git</connection>
10-
<developerConnection>scm:git:git@github.com:TooTallNate/Java-WebSocket.git</developerConnection>
11-
<url>git@github.com:TooTallNate/Java-WebSocket.git</url>
12-
</scm>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
136
<modelVersion>4.0.0</modelVersion>
14-
<groupId>org.java-websocket</groupId>
7+
<groupId>cn.leancloud.android</groupId>
158
<artifactId>Java-WebSocket</artifactId>
16-
<version>1.3.1-SNAPSHOT</version>
9+
<version>1.3.1-leancloud</version>
1710
<packaging>jar</packaging>
1811
<name>Java WebSocket</name>
19-
<url>http://java-websocket.org/</url>
20-
<description>A barebones WebSocket client and server implementation written in 100% Java</description>
12+
<description>A barebones WebSocket client and server implementation written in 100% Java
13+
</description>
2114
<properties>
2215
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2316
<java.version>1.6</java.version>
24-
<cucumber.version>1.0.0.RC24</cucumber.version>
17+
<cucumber.version>1.0.0.RC24</cucumber.version>
2518
</properties>
2619
<build>
2720
<plugins>
@@ -84,59 +77,51 @@
8477
<scope>test</scope>
8578
</dependency>
8679
</dependencies>
87-
<developers>
88-
<developer>
89-
<id>TooTallNate</id>
90-
<name>Nathan Rajlich</name>
91-
<email>nathan@tootallnate.net</email>
92-
<url>https://github.com/TooTallNate</url>
93-
<roles>
94-
<role>founder</role>
95-
</roles>
96-
</developer>
97-
<developer>
98-
<id>Davidiusdadi</id>
99-
<name>David Rohmer</name>
100-
<email>rohmer.david@gmail.com</email>
101-
<url>https://github.com/Davidiusdadi</url>
102-
<roles>
103-
<role>maintainer</role>
104-
</roles>
105-
</developer>
106-
</developers>
10780
<licenses>
10881
<license>
10982
<name>MIT License</name>
110-
<url>http://github.com/TooTallNate/Java-WebSocket/blob/master/LICENSE</url>
11183
</license>
11284
</licenses>
113-
<profiles>
114-
<profile>
115-
<id>release-sign-artifacts</id>
116-
<activation>
117-
<property><name>performRelease</name><value>true</value></property>
118-
</activation>
119-
<build>
120-
<plugins>
121-
<plugin>
122-
<groupId>org.apache.maven.plugins</groupId>
123-
<artifactId>maven-gpg-plugin</artifactId>
124-
<version>1.1</version>
125-
<executions>
126-
<execution>
127-
<id>sign-artifacts</id>
128-
<phase>verify</phase>
129-
<goals>
130-
<goal>sign</goal>
131-
</goals>
132-
</execution>
133-
</executions>
134-
<configuration>
135-
<keyname>rohmer.david@gmail.com</keyname>
136-
</configuration>
137-
</plugin>
138-
</plugins>
139-
</build>
140-
</profile>
141-
</profiles>
85+
<profiles>
86+
<profile>
87+
<id>release-sign-artifacts</id>
88+
<activation>
89+
<property>
90+
<name>performRelease</name>
91+
<value>true</value>
92+
</property>
93+
</activation>
94+
<build>
95+
<plugins>
96+
<plugin>
97+
<groupId>org.apache.maven.plugins</groupId>
98+
<artifactId>maven-gpg-plugin</artifactId>
99+
<version>1.1</version>
100+
<executions>
101+
<execution>
102+
<id>sign-artifacts</id>
103+
<phase>verify</phase>
104+
<goals>
105+
<goal>sign</goal>
106+
</goals>
107+
</execution>
108+
</executions>
109+
<configuration>
110+
<keyname>rohmer.david@gmail.com</keyname>
111+
</configuration>
112+
</plugin>
113+
</plugins>
114+
</build>
115+
</profile>
116+
</profiles>
117+
<distributionManagement>
118+
<snapshotRepository>
119+
<id>snapshots</id>
120+
<url>http://mvn.leancloud.cn/nexus/content/repositories/snapshots/</url>
121+
</snapshotRepository>
122+
<repository>
123+
<id>releases</id>
124+
<url>http://mvn.leancloud.cn/nexus/content/repositories/releases/</url>
125+
</repository>
126+
</distributionManagement>
142127
</project>

src/main/example/ChatClient.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
import javax.swing.JTextArea;
1414
import javax.swing.JTextField;
1515

16-
import org.java_websocket.WebSocketImpl;
17-
import org.java_websocket.client.WebSocketClient;
18-
import org.java_websocket.drafts.Draft;
19-
import org.java_websocket.drafts.Draft_10;
20-
import org.java_websocket.drafts.Draft_17;
21-
import org.java_websocket.drafts.Draft_75;
22-
import org.java_websocket.drafts.Draft_76;
23-
import org.java_websocket.handshake.ServerHandshake;
16+
import com.avos.avoscloud.java_websocket.WebSocketImpl;
17+
import com.avos.avoscloud.java_websocket.client.WebSocketClient;
18+
import com.avos.avoscloud.java_websocket.drafts.Draft;
19+
import com.avos.avoscloud.java_websocket.drafts.Draft_10;
20+
import com.avos.avoscloud.java_websocket.drafts.Draft_17;
21+
import com.avos.avoscloud.java_websocket.drafts.Draft_75;
22+
import com.avos.avoscloud.java_websocket.drafts.Draft_76;
23+
import com.avos.avoscloud.java_websocket.handshake.ServerHandshake;
2424

2525
public class ChatClient extends JFrame implements ActionListener {
2626
private static final long serialVersionUID = -6056260699202978657L;

src/main/example/ChatServer.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
import java.net.InetSocketAddress;
55
import java.net.UnknownHostException;
66
import java.util.Collection;
7-
8-
import org.java_websocket.WebSocket;
9-
import org.java_websocket.WebSocketImpl;
10-
import org.java_websocket.framing.Framedata;
11-
import org.java_websocket.handshake.ClientHandshake;
12-
import org.java_websocket.server.WebSocketServer;
7+
import com.avos.avoscloud.java_websocket.WebSocket;
8+
import com.avos.avoscloud.java_websocket.WebSocketImpl;
9+
import com.avos.avoscloud.java_websocket.handshake.ClientHandshake;
10+
import com.avos.avoscloud.java_websocket.server.WebSocketServer;
1311

1412
/**
1513
* A simple WebSocketServer implementation. Keeps track of a "chatroom".

src/main/example/ExampleClient.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import java.net.URI;
22
import java.net.URISyntaxException;
33

4-
import org.java_websocket.client.WebSocketClient;
5-
import org.java_websocket.drafts.Draft;
6-
import org.java_websocket.drafts.Draft_10;
7-
import org.java_websocket.framing.Framedata;
8-
import org.java_websocket.handshake.ServerHandshake;
4+
import com.avos.avoscloud.java_websocket.client.WebSocketClient;
5+
import com.avos.avoscloud.java_websocket.drafts.Draft;
6+
import com.avos.avoscloud.java_websocket.drafts.Draft_10;
7+
import com.avos.avoscloud.java_websocket.handshake.ServerHandshake;
98

109
/** This example demonstrates how to create a websocket connection to a server. Only the most important callbacks are overloaded. */
1110
public class ExampleClient extends WebSocketClient {

src/main/example/SSLClientExample.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
import javax.net.ssl.SSLSocketFactory;
1111
import javax.net.ssl.TrustManagerFactory;
1212

13-
import org.java_websocket.WebSocketImpl;
14-
import org.java_websocket.client.WebSocketClient;
15-
import org.java_websocket.handshake.ServerHandshake;
13+
import com.avos.avoscloud.java_websocket.WebSocketImpl;
14+
import com.avos.avoscloud.java_websocket.client.DefaultSSLWebSocketClientFactory;
15+
import com.avos.avoscloud.java_websocket.client.WebSocketClient;
16+
import com.avos.avoscloud.java_websocket.handshake.ServerHandshake;
1617

1718
class WebSocketChatClient extends WebSocketClient {
1819

src/main/example/SSLServerExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import javax.net.ssl.SSLContext;
99
import javax.net.ssl.TrustManagerFactory;
1010

11-
import org.java_websocket.WebSocketImpl;
12-
import org.java_websocket.server.DefaultSSLWebSocketServerFactory;
11+
import com.avos.avoscloud.java_websocket.WebSocketImpl;
12+
import com.avos.avoscloud.java_websocket.server.DefaultSSLWebSocketServerFactory;
1313

1414
public class SSLServerExample {
1515

src/main/example/ServerStressTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import javax.swing.event.ChangeEvent;
2222
import javax.swing.event.ChangeListener;
2323

24-
import org.java_websocket.client.WebSocketClient;
24+
import com.avos.avoscloud.java_websocket.client.WebSocketClient;
2525

2626
public class ServerStressTest extends JFrame {
2727
private JSlider clients;

src/main/java/org/java_websocket/AbstractWrappedByteChannel.java renamed to src/main/java/com/avos/avoscloud/java_websocket/AbstractWrappedByteChannel.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.java_websocket;
1+
package com.avos.avoscloud.java_websocket;
22

33
import java.io.IOException;
44
import java.nio.ByteBuffer;
@@ -60,7 +60,12 @@ public boolean isNeedRead() {
6060

6161
@Override
6262
public int readMore( ByteBuffer dst ) throws SSLException {
63-
return channel instanceof WrappedByteChannel ? ( (WrappedByteChannel) channel ).readMore( dst ) : 0;
63+
try {
64+
return channel instanceof WrappedByteChannel ? ( (WrappedByteChannel) channel ).readMore( dst ) : 0;
65+
} catch (IOException e) {
66+
e.printStackTrace();
67+
}
68+
return 0;
6469
}
6570

6671
@Override

0 commit comments

Comments
 (0)