client

package
v0.0.0-...-d9af017 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SHA_DIGEST_LENGTH = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Session   *net2.Session
	RPCClient *grpc_util.RPCClient
	Codec     *MTProtoCodec

	RemoteAddr net.Addr
	LocalAddr  net.Addr

	// TODO(@benqi): 移到handshake处理器里
	Nonce       []byte // 每连接缓存客户端生成的Nonce
	ServerNonce []byte // 每连接缓存服务生成的ServerNonce
	NewNonce    []byte
	A           *big.Int
	P           *big.Int
}

func NewClient

func NewClient(session *net2.Session, rpcClient *grpc_util.RPCClient) (c *Client)

func (*Client) OnEncryptedMessage

func (c *Client) OnEncryptedMessage(request *EncryptedMessage2) error

func (*Client) OnHandshake

func (c *Client) OnHandshake(request *UnencryptedMessage) error

handshake

func (*Client) OnMessage

func (c *Client) OnMessage(msgId int64, seqNo int32, request TLObject) error

TODO(@benqi): 可以不关注seqNo

func (*Client) OnUnencryptedMessage

func (c *Client) OnUnencryptedMessage(request *UnencryptedMessage) error

MsgsAck

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL