1. 28 8月, 2020 1 次提交
    • D
      net_linux.go: decode port as 16-bit uint · 5c1a9e70
      Disconnect3d 提交于
      Changes the port parsing from `/proc/net/*` files records from parsing them as 64-bit integers to parse them as 16-bit unsigned integers.
      
      While this is mostly a cosmetic change, it will also make so that the code fails faster in case the entry is malformed (for whatever reason).
      
      Note that the returned value is still casted to uint32 when an  `Addr` object is created.
      It seems to me that the `Addr.port` field should be changed to `uint16` but maybe some other APIs/systems wants it to be `uint32` and also changing it there may require changes in users code if they update. This being said I am not changing that field's type.
      5c1a9e70
  2. 17 5月, 2020 1 次提交
  3. 01 11月, 2019 1 次提交
  4. 11 7月, 2019 1 次提交
  5. 12 6月, 2019 1 次提交
    • wcc526's avatar
      Fix the net.ConnectionsMax BUG · 809306b7
      wcc526 提交于
      `connectionsList, err := net.ConnectionsMax("tcp4", 1000)`
      when you run net.ConnectionsMax,you will find some proc is not equal with the `netstat -lptn`
      809306b7
  6. 12 5月, 2019 1 次提交
  7. 28 11月, 2018 1 次提交
  8. 20 11月, 2018 1 次提交
  9. 19 11月, 2018 1 次提交
  10. 14 9月, 2018 1 次提交
  11. 31 12月, 2017 1 次提交
  12. 18 11月, 2017 1 次提交
  13. 07 10月, 2017 1 次提交
  14. 10 7月, 2017 2 次提交
  15. 04 5月, 2017 1 次提交
  16. 02 5月, 2017 1 次提交
    • A
      Read /proc/net files with a single read syscall. · 531f9507
      Alexander Blagoev 提交于
      The /proc/net files are not guaranteed to be consistent, they are only
      consitent on the row level. This is probably one of the reasons why
      consequent read calls might return duplicate entries - the kernel is
      changing the file as it is being read. In certain situations this might
      lead to loop like situations - the same net entry is being returned when
      reading the file as new connections are added to the kernel tcp table, i.e
      there can be a lot of duplications.
      
      This commit is trying to reduce the duplications, by fetching the contents
      of the net files with a single read syscall.
      531f9507
  17. 30 4月, 2017 2 次提交
  18. 29 4月, 2017 3 次提交
  19. 28 4月, 2017 1 次提交
  20. 22 2月, 2017 1 次提交
  21. 21 2月, 2017 1 次提交
  22. 21 12月, 2016 1 次提交
    • C
      Fast duplication check in inodes processing. · 276c873f
      Conor Branagan 提交于
      Instead of encoding a JSON string of each connection (non-trivial at high
      connection volumes) we can use the connTmp struct for map look-ups if we
      eliminate the unused `uids` field.
      
      Also switches to using the empty struct instead of bool for zero memory
      overhead.
      276c873f
  23. 20 12月, 2016 1 次提交
  24. 12 12月, 2016 1 次提交
    • C
      Add ConnectionsMax function that limits connections per pid. · 198e65c8
      Conor Branagan 提交于
      The goal is to improve performance of connection fetching connections across
      all processes when some processes can have several hundred or thousands of file
      descriptors. Right now when you have many thousands of fds the process spends
      lots of time inside the syscalls from Readdir and Readlink.
      
      The public API works as before with two new functions:
      
      - `ConnectionsMax`
      - `ConnectionsPidMax`
      
      Each function takes an additional int argument that sets the max number of fds
      read per process.
      198e65c8
  25. 02 12月, 2016 1 次提交
  26. 11 10月, 2016 1 次提交
  27. 06 10月, 2016 2 次提交
  28. 13 6月, 2016 1 次提交
  29. 23 3月, 2016 1 次提交
  30. 22 3月, 2016 1 次提交
  31. 10 3月, 2016 1 次提交
  32. 05 3月, 2016 2 次提交
  33. 04 3月, 2016 1 次提交
  34. 01 3月, 2016 1 次提交