Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PingConn ¶
PingConn wraps a net.Conn and add ping capabilities to it, including the `WritePing` function and `Read` (which excludes ping packets).
When using this connection, the packets written will contain an initial data: the packet size. When reading, this information is taken into account, but it is not returned to the caller.
Ping messages have a packet size of zero and are produced only when `WritePing` is called. On `Read`, any Ping packet is discarded.
func (*PingConn) Read ¶
Read reads content from the underlying connection, discarding any ping messages it finds.
type PingTLSConn ¶
PingTLSConn wraps a tls.Conn and adds ping capabilities to it.
func NewTLS ¶
func NewTLS(conn *tls.Conn) *PingTLSConn
NewTLS returns a ping connection wrapping the provided tls.Conn.
func (*PingTLSConn) Read ¶
func (c *PingTLSConn) Read(p []byte) (int, error)
Read reads content from the underlying connection, discarding any ping messages it finds.
func (*PingTLSConn) Write ¶
func (c *PingTLSConn) Write(p []byte) (int, error)
Write writes provided content to the underlying connection with proper protocol fields.
func (*PingTLSConn) WritePing ¶
func (c *PingTLSConn) WritePing() error
WritePing writes the ping packet to the connection.