mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 14:44:15 +00:00
init
This commit is contained in:
commit
4c03bf0d45
10 files changed
+338
No files matched your search
@@ -0,0 +1,27 @@
|
||||
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
|
||||
}
|
||||
Reference in new issue
Block a user