mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
test: 尝试启用xray splice拷贝
This commit is contained in:
25
common/counter/xraytraffic.go
Normal file
25
common/counter/xraytraffic.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package counter
|
||||
|
||||
import (
|
||||
"sync/atomic"
|
||||
|
||||
fstats "github.com/xtls/xray-core/features/stats"
|
||||
)
|
||||
|
||||
var _ fstats.Counter = (*XrayTrafficCounter)(nil)
|
||||
|
||||
type XrayTrafficCounter struct {
|
||||
V *atomic.Int64
|
||||
}
|
||||
|
||||
func (c *XrayTrafficCounter) Value() int64 {
|
||||
return c.V.Load()
|
||||
}
|
||||
|
||||
func (c *XrayTrafficCounter) Set(newValue int64) int64 {
|
||||
return c.V.Swap(newValue)
|
||||
}
|
||||
|
||||
func (c *XrayTrafficCounter) Add(delta int64) int64 {
|
||||
return c.V.Add(delta)
|
||||
}
|
||||
Reference in New Issue
Block a user