|
3 | 3 | import com.ss.editor.annotation.FromAnyThread; |
4 | 4 | import com.ss.editor.config.Config; |
5 | 5 | import com.ss.editor.manager.ClasspathManager.Scope; |
| 6 | +import com.ss.rlib.network.NetworkConfig; |
6 | 7 | import com.ss.rlib.network.NetworkFactory; |
7 | 8 | import com.ss.rlib.network.packet.ReadablePacket; |
8 | 9 | import com.ss.rlib.network.packet.ReadablePacketRegistry; |
| 10 | +import com.ss.rlib.network.server.AcceptHandler; |
9 | 11 | import com.ss.rlib.network.server.ServerNetwork; |
10 | 12 | import org.jetbrains.annotations.NotNull; |
11 | 13 | import org.jetbrains.annotations.Nullable; |
|
20 | 22 | */ |
21 | 23 | public class RemoteControlManager { |
22 | 24 |
|
| 25 | + @NotNull |
| 26 | + private static final NetworkConfig NETWORK_CONFIG = new NetworkConfig() { |
| 27 | + |
| 28 | + @Override |
| 29 | + public int getReadBufferSize() { |
| 30 | + return Short.MAX_VALUE * 2; |
| 31 | + } |
| 32 | + |
| 33 | + @Override |
| 34 | + public int getWriteBufferSize() { |
| 35 | + return Short.MAX_VALUE * 2; |
| 36 | + } |
| 37 | + }; |
| 38 | + |
23 | 39 | @Nullable |
24 | 40 | private static RemoteControlManager instance; |
25 | 41 |
|
@@ -56,7 +72,7 @@ private synchronized void start() { |
56 | 72 | return; |
57 | 73 | } |
58 | 74 |
|
59 | | - serverNetwork = NetworkFactory.newDefaultAsyncServerNetwork(packetRegistry); |
| 75 | + serverNetwork = NetworkFactory.newDefaultAsyncServerNetwork(NETWORK_CONFIG, packetRegistry, AcceptHandler.newDefault()); |
60 | 76 | try { |
61 | 77 | serverNetwork.bind(new InetSocketAddress(Config.REMOTE_CONTROL_PORT)); |
62 | 78 | } catch (final IOException e) { |
|
0 commit comments