documentation

This commit is contained in:
V2Ray committed 2015-09-07 12:00:46 +02:00
1 parent b5a46dec8e
commit 306ae93503
5 files changed
+27 -5

No files matched your search

+6 -1
View File
@@ -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)