mightofcode / android-vpnservice-example

a android vpnservice example, use blocking io
Apache License 2.0
185 stars 59 forks source link

改这里性能会有质的提升 #7

Open varvarbbs opened 2 years ago

varvarbbs commented 2 years ago

private ByteBuffer remoteOutBuffer = ByteBuffer.allocate(8 * 1024); 改为 private ByteBuffer remoteOutBuffer = ByteBuffer.allocate(Short.MAX_VALUE);
具体原因我也不太清楚

另外从外网回写时不知能不能多开线程处理呢? Thread t = new Thread(new WriteVpnThread(vpnOutput, networkToDeviceQueue)); t.start();

Attect commented 1 year ago

内存:请好好的考虑我