mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 14:44:15 +00:00
documentation
This commit is contained in:
1 parent
b5a46dec8e
commit
306ae93503
5 files changed
+27
-5
No files matched your search
@@ -9,8 +9,11 @@ type VPoint struct {
|
||||
connHandler ConnectionHandler
|
||||
}
|
||||
|
||||
// NewVPoint returns a new VPoint server based on given configuration.
|
||||
// The server is not started at this point.
|
||||
func NewVPoint(config *VConfig) (*VPoint, error) {
|
||||
var vpoint *VPoint
|
||||
var vpoint = new(VPoint)
|
||||
vpoint.config = *config
|
||||
return vpoint, nil
|
||||
}
|
||||
|
||||
@@ -18,6 +21,8 @@ type ConnectionHandler interface {
|
||||
Listen(port uint16) error
|
||||
}
|
||||
|
||||
// Start starts the VPoint server, and return any error during the process.
|
||||
// In the case of any errors, the state of the server is unpredicatable.
|
||||
func (vp *VPoint) Start() error {
|
||||
if vp.config.Port <= 0 {
|
||||
return fmt.Errorf("Invalid port %d", vp.config.Port)
|
||||
|
||||
Reference in new issue
Block a user