mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-06 09:15:37 -05:00
refactor common/net.Port
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
type Port uint16
|
||||
|
||||
func NewPort(port int) Port {
|
||||
return Port(uint16(port))
|
||||
func PortFromBytes(port []byte) Port {
|
||||
return Port(uint16(port[0])<<8 + uint16(port[1]))
|
||||
}
|
||||
|
||||
func (this Port) Value() uint16 {
|
||||
|
||||
Reference in New Issue
Block a user