Commit Graph

8 Commits

Author SHA1 Message Date
Tevin Zhang b4b7e90e24 Find an address that will actually timeout in tests by testing 2019-03-06 16:24:31 +08:00
Tevin Zhang 0d34068678 Use 10.255.255.1:80 as an always-timeout address
Since 10.0.0.0:1 causes ErrConnect(permission denied) instead of ErrTimeout in Travis CI's macOS environment.
2019-02-13 11:05:36 +08:00
Tevin Zhang 6868d911df Add logging 2019-02-13 11:05:36 +08:00
Tevin Zhang f00667a79b WaitReady() before using checker 2019-02-12 16:19:46 +08:00
Tevin Zhang a89fc1fe18 Refactor
Significant changes:

1. `NewChecker()` accepts no argument, `zeroLinger` is enabled by default
2. Optional parameter `zeroLinger` in `CheckAddr()` turned into `CheckerAddrZeroLinger()`
3. `InitChecker()` -> `CheckingLoop(context)`
4. `ErrNotInitialized` -> `ErrCheckerAlreadyStarted`
5. Fewer system call calling, e.g. `connect()` is called exactly once per check
6. Epoll is now edge-triggered
2019-02-11 17:54:51 +08:00
Tevin Zhang ce742af518 Add fake implementation for non-Linux platform 2016-12-06 17:20:41 +08:00
Tevin Zhang 2d25c4a3e0 Retry connect when EINPROGRESS etc is encountered
Version older than this may leads to false positive results from CheckAddr
2016-10-18 21:00:00 +08:00
Tevin Zhang 882b0fcc11 A lot of adjustments
1. 'shaker' renamed to 'check', should have named the repo to
tcp-checker
2. Add NewChecker() for creation
3. Add parameter zeroLinger
4. More error handling (Error from syscall.Close is returned)
2016-07-26 19:25:46 +08:00