1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-29 23:36:25 -04:00
v2fly/common/buf/io_highend.go
2018-08-17 11:52:55 +02:00

24 lines
407 B
Go

// +build 386 amd64 s390 s390x
package buf
import (
"io"
"syscall"
)
func newReaderPlatform(reader io.Reader) Reader {
if useReadv {
if sc, ok := reader.(syscall.Conn); ok {
rawConn, err := sc.SyscallConn()
if err != nil {
newError("failed to get sysconn").Base(err).WriteToLog()
} else {
return NewReadVReader(reader, rawConn)
}
}
}
return NewBytesToBufferReader(reader)
}