Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommonPrefixLen ¶
CommonPrefixLen returns the length of common prefix
func DecodeCompactIPPortInfo ¶
DecodeCompactIPPortInfo decodes compactIP-address/port info in BitTorrent DHT Protocol. It returns the ip and port number.
func EncodeCompactIPPortInfo ¶
EncodeCompactIPPortInfo encodes an ip and a port number to compactIP-address/port info.
func RandomString ¶
RandomString generates a size-length string randomly.
Types ¶
type StreamReader ¶
type StreamReader struct {
// contains filtered or unexported fields
}
StreamReader implements buffering for an io.StreamReader object.
func NewStreamReader ¶
func NewStreamReader(conn net.Conn, timeout time.Duration) *StreamReader
NewStreamReader returns a new Reader.
type StreamWriter ¶
type StreamWriter struct {
// contains filtered or unexported fields
}
StreamWriter is stream writer
func NewStreamWriter ¶
func NewStreamWriter(conn net.Conn, timeout time.Duration) *StreamWriter
NewStreamWriter returns a new Writer.
Click to show internal directories.
Click to hide internal directories.