mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-05 16:15:43 +00:00
25 lines
319 B
Go
25 lines
319 B
Go
package message
|
|
|
|
// choke: <len=0001><id=0>
|
|
type Choke struct {
|
|
Message
|
|
}
|
|
|
|
func NewChoke() *Choke {
|
|
return &Choke{
|
|
Message{
|
|
Length: 1,
|
|
ID: IdChoke,
|
|
},
|
|
}
|
|
}
|
|
|
|
func (c *Choke) Encode() []byte {
|
|
return c.Message.Encode()
|
|
}
|
|
|
|
func (c *Choke) Decode(buf []byte) Serialize {
|
|
c.Message.Decode(buf)
|
|
return c
|
|
}
|