1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 15:36:41 -05:00

Add comment

This commit is contained in:
Xiaokang Wang 2018-04-06 20:29:08 +08:00 committed by GitHub
parent 6d1faf5f6e
commit 00016e0517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,9 @@ func (ls *Listener) LowerUP() error {
} }
return err return err
} }
//If the unix domain socket is filesystem based, an file lock must be used to claim the right for listening on respective file.
//https://gavv.github.io/blog/unix-socket-reuse/
if isUnixDomainSocketFileSystemBased(ls.path) && !___DEBUG_IGNORE_FLOCK { if isUnixDomainSocketFileSystemBased(ls.path) && !___DEBUG_IGNORE_FLOCK {
ls.lockfile, err = acquireLock(ls.path + ".lock") ls.lockfile, err = acquireLock(ls.path + ".lock")
if err != nil { if err != nil {
@ -136,6 +138,7 @@ func (ls *Listener) uploop(cctx context.Context) {
if err != nil { if err != nil {
newError("Cannot Accept socket from listener").Base(err).AtDebug().WriteToLog() newError("Cannot Accept socket from listener").Base(err).AtDebug().WriteToLog()
//Guard against too many open file error
if err == lasterror { if err == lasterror {
errortolerance-- errortolerance--
if errortolerance == 0 { if errortolerance == 0 {