Small improvements
This commit is contained in:
committed by
Jack Christensen
parent
8b5e8d9d89
commit
a83faa67f5
@@ -97,7 +97,7 @@ type NetConn struct {
|
||||
writeDeadlineLock sync.Mutex
|
||||
writeDeadline time.Time
|
||||
|
||||
// Indicates that underlying socket connection mode set to be non-blocking
|
||||
// Indicates that underlying socket connection mode explicitly set to be non-blocking
|
||||
isNonBlocking bool
|
||||
}
|
||||
|
||||
|
||||
@@ -164,9 +164,11 @@ func (c *NetConn) SetBlockingMode(blocking bool) error {
|
||||
|
||||
var err error
|
||||
|
||||
c.rawConn.Control(func(fd uintptr) {
|
||||
if ctrlErr := c.rawConn.Control(func(fd uintptr) {
|
||||
err = setSockMode(fd, mode)
|
||||
})
|
||||
}); ctrlErr != nil {
|
||||
return ctrlErr
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
c.isNonBlocking = !blocking
|
||||
|
||||
Reference in New Issue
Block a user