Skip to content

Commit 01d4f41

Browse files
Little fixes in WebSocket's
Change-Id: If71f5dd814fa08240b43981b3265f4b25c8a9e23
1 parent 844ec4c commit 01d4f41

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

AndroidSocketIO/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies {
2929
androidTestCompile fileTree(dir: 'src/androidTest/libs', include: '*.jar')
3030
}
3131

32-
def baseVersionName = "1.1.1"
32+
def baseVersionName = "1.1.2"
3333
if (project.hasProperty("versionSuffix")) {
3434
project.ext.versionSuffix = project.versionSuffix
3535
} else {

AndroidSocketIO/src/main/java/com/appunite/websocket/WebSocketListener.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface WebSocketListener {
3434
* @throws InterruptedException
3535
* @throws NotConnectedException
3636
*/
37-
void onConnected() throws IOException, InterruptedException,
37+
public void onConnected() throws IOException, InterruptedException,
3838
NotConnectedException;
3939

4040
/**
@@ -44,7 +44,7 @@ void onConnected() throws IOException, InterruptedException,
4444
* @throws InterruptedException
4545
* @throws NotConnectedException
4646
*/
47-
void onStringMessage(String message) throws IOException,
47+
public void onStringMessage(String message) throws IOException,
4848
InterruptedException, NotConnectedException;
4949

5050
/**
@@ -54,7 +54,7 @@ void onStringMessage(String message) throws IOException,
5454
* @throws InterruptedException
5555
* @throws NotConnectedException
5656
*/
57-
void onBinaryMessage(byte[] data) throws IOException,
57+
public void onBinaryMessage(byte[] data) throws IOException,
5858
InterruptedException, NotConnectedException;
5959

6060
/**
@@ -64,7 +64,7 @@ void onBinaryMessage(byte[] data) throws IOException,
6464
* @throws InterruptedException
6565
* @throws NotConnectedException
6666
*/
67-
void onPing(byte[] data) throws IOException, InterruptedException,
67+
public void onPing(byte[] data) throws IOException, InterruptedException,
6868
NotConnectedException;
6969

7070
/**
@@ -74,7 +74,7 @@ void onPing(byte[] data) throws IOException, InterruptedException,
7474
* @throws InterruptedException
7575
* @throws NotConnectedException
7676
*/
77-
void onPong(byte[] data) throws IOException, InterruptedException,
77+
public void onPong(byte[] data) throws IOException, InterruptedException,
7878
NotConnectedException;
7979

8080
/**
@@ -84,7 +84,7 @@ void onPong(byte[] data) throws IOException, InterruptedException,
8484
* @throws InterruptedException
8585
* @throws NotConnectedException
8686
*/
87-
void onServerRequestedClose(byte[] data) throws IOException,
87+
public void onServerRequestedClose(byte[] data) throws IOException,
8888
InterruptedException, NotConnectedException;
8989

9090
/**
@@ -94,7 +94,7 @@ void onServerRequestedClose(byte[] data) throws IOException,
9494
* @throws InterruptedException
9595
* @throws NotConnectedException
9696
*/
97-
void onUnknownMessage(byte[] data) throws IOException,
97+
public void onUnknownMessage(byte[] data) throws IOException,
9898
InterruptedException, NotConnectedException;
9999

100100
}

AndroidSocketIO/src/main/java/com/appunite/websocket/WebSocketReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.appunite.websocket;
1818

1919
import java.io.DataInputStream;
20+
import java.io.EOFException;
2021
import java.io.IOException;
2122
import java.io.InputStream;
2223

@@ -33,11 +34,10 @@ public WebSocketReader(InputStream inputStream) {
3334
this.mInputStream = new DataInputStream(inputStream);
3435
}
3536

36-
public int readByteOrThrow() throws IOException, WrongWebsocketResponse {
37+
public int readByteOrThrow() throws IOException {
3738
int read = mInputStream.read();
3839
if (read == -1) {
39-
// Maybe we should return ConnectionClosed
40-
throw new WrongWebsocketResponse("Socket closed");
40+
throw new EOFException("Socket closed");
4141
}
4242
return read;
4343
}

0 commit comments

Comments
 (0)