mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-22 05:29:14 -04:00
adjust receiving buffer size
This commit is contained in:
@@ -44,15 +44,18 @@ func (this *Config) GetSendingBufferSize() uint32 {
|
||||
return this.GetSendingInFlightSize() + this.WriteBuffer/this.Mtu
|
||||
}
|
||||
|
||||
func (this *Config) GetReceivingBufferSize() uint32 {
|
||||
func (this *Config) GetReceivingInFlightSize() uint32 {
|
||||
size := this.DownlinkCapacity * 1024 * 1024 / this.Mtu / (1000 / this.Tti) / 2
|
||||
if size < 8 {
|
||||
size = 8
|
||||
}
|
||||
size += this.ReadBuffer / this.Mtu
|
||||
return size
|
||||
}
|
||||
|
||||
func (this *Config) GetReceivingBufferSize() uint32 {
|
||||
return this.GetReceivingInFlightSize() + this.ReadBuffer/this.Mtu
|
||||
}
|
||||
|
||||
func DefaultConfig() Config {
|
||||
return Config{
|
||||
Mtu: 1350,
|
||||
|
||||
Reference in New Issue
Block a user