Skip to content

Commit 5ee460e

Browse files
committed
Use large polling size for baseless reads
1 parent 3bbb12c commit 5ee460e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/java/org/monora/coolsocket/core/config/Config.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ public final class Config
1515
*/
1616
public static final int DEFAULT_BUFFER_SIZE = 8192;
1717

18+
/**
19+
* The default internal cache size spared for polling requests in memory.
20+
*/
21+
public static final int DEFAULT_INTERNAL_CACHE_SIZE = 0x100000;
22+
1823
/**
1924
* The default inverse exchange point number.
2025
* <p>

src/main/java/org/monora/coolsocket/core/session/ActiveConnection.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
import java.nio.channels.ReadableByteChannel;
1717
import java.nio.channels.WritableByteChannel;
1818

19-
import static org.monora.coolsocket.core.config.Config.DEFAULT_BUFFER_SIZE;
20-
import static org.monora.coolsocket.core.config.Config.DEFAULT_INVERSE_EXCHANGE_POINT;
19+
import static org.monora.coolsocket.core.config.Config.*;
2120

2221
/**
2322
* This class connects to both clients and servers. This accepts a valid socket instance, and writes to and reads from
@@ -35,7 +34,7 @@ public class ActiveConnection implements Closeable
3534

3635
private ReadableByteChannel readableByteChannel;
3736

38-
private int internalCacheSize = DEFAULT_BUFFER_SIZE;
37+
private int internalCacheSize = DEFAULT_INTERNAL_CACHE_SIZE;
3938

4039
private int nextOperationId = 0;
4140

0 commit comments

Comments
 (0)