Skip to content

Commit 919e0cf

Browse files
committed
Fix perMessageDeflate setting
Add Javadocs for new settings
1 parent 62ad1c3 commit 919e0cf

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/main/java/io/github/sac/Socket.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class Socket extends Emitter {
3535
private Map<String, String> headers;
3636
private SocketClusterCodec codec;
3737
private int connectionTimeout = 5000;
38-
private boolean perMessageDeflate;
38+
private boolean perMessageDeflate = true;
3939

4040
private static final ObjectMapper mapper = new ObjectMapper();
4141

@@ -91,12 +91,19 @@ public void setCodec(SocketClusterCodec codec) {
9191
this.codec = codec;
9292
}
9393

94+
/**
95+
* Set Websocket connection timeout - set to 5000 by default
96+
* @param timeout - connection timeout in Milliseconds
97+
*/
9498
public void setConnectionTimeout(int timeout) {
9599
connectionTimeout = timeout;
96100
}
97101

98-
public void setPerMessageDeflateCompression(boolean enable) {
99-
perMessageDeflate = enable;
102+
/**
103+
* Disable Websocket perMessageDeflate compression, which is enabled by default
104+
*/
105+
public void disablePerMessageDeflateCompression() {
106+
perMessageDeflate = false;
100107
}
101108

102109
/**

0 commit comments

Comments
 (0)