netstat

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TcpConnection

type TcpConnection struct {
	// tcp, tcp6, udp, udp6, ...
	Proto string
	// Recv-Q 表示接收队列的长度,即等待应用程序读取的数据量。如果 Recv-Q 的值很大,说明应用程序没有及时读取数据,或者网络拥塞导致数据传输缓慢。
	RecvQ int

	// Send-Q 表示发送队列的长度,即等待发送的数据量。如果 Send-Q 的值很大,说明应用程序发送的数据量很大,或者网络拥塞导致数据传输缓慢。
	SendQ       int
	LocalAddr   string
	ForeignAddr string
	State       string
	Program     string
	Pid         string
}

func GetAllTcpConnections

func GetAllTcpConnections() (conns []TcpConnection, err error)

* # netstat -antup 输出保存到stdout中,格式如下: Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 10.244.64.176:54764 192.168.145.102:4318 ESTABLISHED 1/mpush-server tcp 0 0 10.244.64.176:45146 47.93.126.196:443 ESTABLISHED 1/mpush-server tcp 0 0 10.244.64.176:43816 10.245.218.86:80 ESTABLISHED 1/mpush-server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL