Files
v2ray_simple/netLayer/netlayer.go

25 lines
488 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Package netLayer contains definitions in network layer AND transport layer.
比如路由功能一般是 netLayer去做.
以后如果要添加 domain socket, kcp 或 raw socket 等底层协议时或者要控制tcp/udp拨号的细节时也要在此包里实现.
*/
package netLayer
import "net"
func IsBasicConn(r interface{}) bool {
switch r.(type) {
case *net.TCPConn:
return true
case *net.UDPConn:
return true
case *net.UnixConn:
return true
}
return false
}