1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 12:35:21 -05:00

move port out of address

This commit is contained in:
v2ray
2015-12-16 23:53:38 +01:00
parent 4be7cd7908
commit 34a0cb0b70
34 changed files with 194 additions and 172 deletions

View File

@@ -13,7 +13,7 @@ type Server struct {
accepting bool
}
func (server *Server) Start() (v2net.Address, error) {
func (server *Server) Start() (v2net.Destination, error) {
listener, err := net.ListenTCP("tcp", &net.TCPAddr{
IP: []byte{0, 0, 0, 0},
Port: int(server.Port),
@@ -24,7 +24,7 @@ func (server *Server) Start() (v2net.Address, error) {
}
go server.acceptConnections(listener)
localAddr := listener.Addr().(*net.TCPAddr)
return v2net.IPAddress(localAddr.IP, v2net.Port(localAddr.Port)), nil
return v2net.TCPDestination(v2net.IPAddress(localAddr.IP), v2net.Port(localAddr.Port)), nil
}
func (server *Server) acceptConnections(listener *net.TCPListener) {