You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
v2ray-core/transport/ray/direct.go

39 lines
716 B

package ray
import (
"github.com/v2ray/v2ray-core/common/alloc"
)
const (
bufferSize = 128
)
9 years ago
// NewRay creates a new Ray for direct traffic transport.
func NewRay() Ray {
return &directRay{
Input: make(chan *alloc.Buffer, bufferSize),
Output: make(chan *alloc.Buffer, bufferSize),
}
}
type directRay struct {
Input chan *alloc.Buffer
Output chan *alloc.Buffer
}
9 years ago
func (this *directRay) OutboundInput() <-chan *alloc.Buffer {
return this.Input
}
9 years ago
func (this *directRay) OutboundOutput() chan<- *alloc.Buffer {
return this.Output
}
9 years ago
func (this *directRay) InboundInput() chan<- *alloc.Buffer {
return this.Input
}
9 years ago
func (this *directRay) InboundOutput() <-chan *alloc.Buffer {
return this.Output
}