github.com/xtls/xray-core@v1.8.12-0.20240518155711-3168d27b0bdb/common/net/system.go (about)

     1  package net
     2  
     3  import "net"
     4  
     5  // DialTCP is an alias of net.DialTCP.
     6  var (
     7  	DialTCP  = net.DialTCP
     8  	DialUDP  = net.DialUDP
     9  	DialUnix = net.DialUnix
    10  	Dial     = net.Dial
    11  )
    12  
    13  type ListenConfig = net.ListenConfig
    14  
    15  var (
    16  	Listen     = net.Listen
    17  	ListenTCP  = net.ListenTCP
    18  	ListenUDP  = net.ListenUDP
    19  	ListenUnix = net.ListenUnix
    20  )
    21  
    22  var LookupIP = net.LookupIP
    23  
    24  var FileConn = net.FileConn
    25  
    26  // ParseIP is an alias of net.ParseIP
    27  var ParseIP = net.ParseIP
    28  
    29  var SplitHostPort = net.SplitHostPort
    30  
    31  var CIDRMask = net.CIDRMask
    32  
    33  type (
    34  	Addr       = net.Addr
    35  	Conn       = net.Conn
    36  	PacketConn = net.PacketConn
    37  )
    38  
    39  type (
    40  	TCPAddr = net.TCPAddr
    41  	TCPConn = net.TCPConn
    42  )
    43  
    44  type (
    45  	UDPAddr = net.UDPAddr
    46  	UDPConn = net.UDPConn
    47  )
    48  
    49  type (
    50  	UnixAddr = net.UnixAddr
    51  	UnixConn = net.UnixConn
    52  )
    53  
    54  // IP is an alias for net.IP.
    55  type (
    56  	IP     = net.IP
    57  	IPMask = net.IPMask
    58  	IPNet  = net.IPNet
    59  )
    60  
    61  const (
    62  	IPv4len = net.IPv4len
    63  	IPv6len = net.IPv6len
    64  )
    65  
    66  type (
    67  	Error     = net.Error
    68  	AddrError = net.AddrError
    69  )
    70  
    71  type (
    72  	Dialer       = net.Dialer
    73  	Listener     = net.Listener
    74  	TCPListener  = net.TCPListener
    75  	UnixListener = net.UnixListener
    76  )
    77  
    78  var (
    79  	ResolveUnixAddr = net.ResolveUnixAddr
    80  	ResolveUDPAddr  = net.ResolveUDPAddr
    81  )
    82  
    83  type Resolver = net.Resolver