Documentation
¶
Index ¶
- Variables
- type Client
- func (client *Client) Connect() (err error)
- func (client *Client) Disconnect() (err error)
- func (client *Client) Download()
- func (client *Client) PingContext(ctx context.Context) (int64, error)
- func (client *Client) Read() ([]byte, error)
- func (client *Client) Upload()
- func (client *Client) Version() string
- func (client *Client) Write(data []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEchoData = errors.New("incorrect echo data") ErrEmptyConn = errors.New("empty conn") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Disconnect ¶
func (*Client) PingContext ¶
PingContext Measure latency(RTT) between client and server. We use the 2RTT method to obtain three RTT result in order to get more data in less time (t2-t0, t4-t2, t3-t1). And give lower weight to the delay measured by the server. local factor = 0.4 * 2 and remote factor = 0.2 latency = 0.4 * (t2 - t0) + 0.4 * (t4 - t2) + 0.2 * (t3 - t1) @return cumulative delay in nanoseconds
Click to show internal directories.
Click to hide internal directories.