Method
ApplySocketWriteTimeout
(conn net.Conn, callback func())
Source from the content-addressed store, hash-verified
| 68 | } |
| 69 | |
| 70 | func (self *CoreTCPSocketOption) ApplySocketWriteTimeout(conn net.Conn, callback func()) { |
| 71 | |
| 72 | if self.writeTimeout > 0 { |
| 73 | |
| 74 | conn.SetWriteDeadline(time.Now().Add(self.writeTimeout)) |
| 75 | callback() |
| 76 | conn.SetWriteDeadline(time.Time{}) |
| 77 | |
| 78 | } else { |
| 79 | callback() |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func (self *CoreTCPSocketOption) Init() { |
| 84 | self.readBufferSize = -1 |
Callers
nothing calls this directly
Tested by
no test coverage detected