Documentation
¶
Index ¶
- Variables
- func IPTablesReset()
- func SetBPFFilterPort(conn *net.IPConn, port uint32) error
- func SetBPFFilterPortByPacketConn(pc *ipv4.PacketConn, port uint32) error
- type FingerPrintType
- type TCPConn
- func (conn TCPConn) Close() error
- func (conn TCPConn) LocalAddr() net.Addr
- func (conn TCPConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (conn TCPConn) ReadFromv2() ([]byte, net.Addr, error)
- func (conn TCPConn) RemoteAddr() net.Addr
- func (conn TCPConn) SetDSCP(dscp int) error
- func (conn TCPConn) SetDeadline(t time.Time) error
- func (conn TCPConn) SetReadBuffer(bytes int) error
- func (conn TCPConn) SetReadDeadline(t time.Time) error
- func (conn TCPConn) SetWriteBuffer(bytes int) error
- func (conn TCPConn) SetWriteDeadline(t time.Time) error
- func (conn TCPConn) WriteTo(p []byte, addr net.Addr) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var BatchSize int = 4
View Source
var (
ErrFlowNotFound = errors.New("flow not found") // Duration to define expiration time for flows
)
View Source
var MaxPayloadSize int = 52048 // 2048 //如果对方不会发送大报文,建议设置为2048
Functions ¶
func IPTablesReset ¶
func IPTablesReset()
func SetBPFFilterPortByPacketConn ¶
func SetBPFFilterPortByPacketConn(pc *ipv4.PacketConn, port uint32) error
https://www.kernel.org/doc/Documentation/networking/filter.rst
Types ¶
type TCPConn ¶
type TCPConn struct {
// contains filtered or unexported fields
}
TCPConn
func (TCPConn) ReadFromv2 ¶ added in v0.1.2
相比ReadFrom, ReadFromv2优点是少一次copy, 直接返回数据切片,缺点是没有实现接口 PacketConn ReadFrom method.
func (TCPConn) RemoteAddr ¶
add by mo: 只有client 才会返回remote addr
func (TCPConn) SetDSCP ¶
SetDSCP sets the 6bit DSCP field in IPv4 header, or 8bit Traffic Class in IPv6 header.
func (TCPConn) SetDeadline ¶
SetDeadline implements the Conn SetDeadline method.
func (TCPConn) SetReadBuffer ¶
SetReadBuffer sets the size of the operating system's receive buffer associated with the connection.
func (TCPConn) SetReadDeadline ¶
SetReadDeadline implements the Conn SetReadDeadline method.
func (TCPConn) SetWriteBuffer ¶
SetWriteBuffer sets the size of the operating system's transmit buffer associated with the connection.
func (TCPConn) SetWriteDeadline ¶
SetWriteDeadline implements the Conn SetWriteDeadline method.
Directories
¶
| Path | Synopsis |
|---|---|
|
example/client
command
|
|
|
example/server
command
|
|
|
fecv2
package kcp
|
package kcp |
Click to show internal directories.
Click to hide internal directories.