1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-29 09:09:07 -04:00

more docs

This commit is contained in:
V2 Ray
2015-09-21 10:15:25 +00:00
parent e4b6d5e0f0
commit 313aec4097
3 changed files with 23 additions and 15 deletions

View File

@@ -1,18 +1,21 @@
package net
// Destination represents a network destination including address and protocol (tcp / udp).
type Destination interface {
Network() string
Address() Address
String() string
Network() string // Protocol of communication (tcp / udp)
Address() Address // Address of destination
String() string // String representation of the destination
IsTCP() bool
IsUDP() bool
IsTCP() bool // True if destination is reachable via TCP
IsUDP() bool // True if destination is reachable via UDP
}
// NewTCPDestination creates a TCP destination with given address
func NewTCPDestination(address Address) Destination {
return TCPDestination{address: address}
}
// NewUDPDestination creates a UDP destination with given address
func NewUDPDestination(address Address) Destination {
return UDPDestination{address: address}
}