mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 01:34:02 +03:00
FILE / ScuroNeko/mtg
mtproto/rpc/handshake_request.go
Исходный файл и его история в репозитории.
23 lines
446 B
Go
23 lines
446 B
Go
package rpc
|
|
|
|
import "bytes"
|
|
|
|
type HandshakeRequest struct {
|
|
}
|
|
|
|
func (r *HandshakeRequest) Bytes() []byte {
|
|
buf := &bytes.Buffer{}
|
|
buf.Grow(len(TagHandshake) + len(HandshakeFlags) + len(HandshakeSenderPID) + len(HandshakePeerPID))
|
|
|
|
buf.Write(TagHandshake)
|
|
buf.Write(HandshakeFlags)
|
|
buf.Write(HandshakeSenderPID)
|
|
buf.Write(HandshakePeerPID)
|
|
|
|
return buf.Bytes()
|
|
}
|
|
|
|
func NewHandshakeRequest() *HandshakeRequest {
|
|
return &HandshakeRequest{}
|
|
}
|