1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-10 20:26:29 -05:00
v2fly/vpoint.go

27 lines
445 B
Go
Raw Normal View History

2015-09-05 11:48:38 -04:00
package core
import (
"fmt"
)
type VPoint struct {
config VConfig
connHandler ConnectionHandler
}
func NewVPoint(config *VConfig) (*VPoint, error) {
var vpoint *VPoint
return vpoint, nil
}
type ConnectionHandler interface {
Listen(port uint16) error
}
func (vp *VPoint) Start() error {
if vp.config.Port <= 0 {
return fmt.Errorf("Invalid port %d", vp.config.Port)
}
vp.connHandler.Listen(vp.config.Port)
return nil
}