Documentation ¶
Index ¶
- Variables
- func AddClient(client *Client)
- func IsUserOnline(uid int64) bool
- func Listen(f func(*net.TCPConn), listenAddr string)
- func RemoveClient(client *Client)
- func Run(addr string)
- type Client
- func (client *Client) HandleMessage(msg *meim.InternalMessage)
- func (client *Client) HandlePublish(msg *meim.InternalMessage)
- func (client *Client) HandleSubscribe(uid int64)
- func (client *Client) HandleUnsubscribe(uid int64)
- func (client *Client) Push()
- func (client *Client) Read()
- func (client *Client) Run()
- func (client *Client) Write()
- type ClientSet
- type Route
- type TCPBrokerClient
- func (tr *TCPBrokerClient) Close()
- func (tr *TCPBrokerClient) Connect()
- func (tr *TCPBrokerClient) ReceiveMessage() (*meim.InternalMessage, error)
- func (tr *TCPBrokerClient) SendMessage(msg *meim.InternalMessage) error
- func (tr *TCPBrokerClient) Subscribe(uid int64)
- func (tr *TCPBrokerClient) SyncMessage(msg *meim.InternalMessage) (*meim.InternalMessage, error)
- func (tr *TCPBrokerClient) UnSubscribe(uid int64)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Subcmd int Unsubcmd int DC meim.DataCreator )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) HandleMessage ¶
func (client *Client) HandleMessage(msg *meim.InternalMessage)
实际消息处理
func (*Client) HandlePublish ¶
func (client *Client) HandlePublish(msg *meim.InternalMessage)
处理发布单聊消息
type ClientSet ¶
type ClientSet map[*Client]struct{}
func NewClientSet ¶
func NewClientSet() ClientSet
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
对应每个comect的Route,记录每个comect的用户信息
func (*Route) ContainUserID ¶
func (*Route) GetUserIDs ¶
func (*Route) IsUserOnline ¶
func (*Route) RemoveUserID ¶
type TCPBrokerClient ¶
type TCPBrokerClient struct {
// contains filtered or unexported fields
}
func NewTCPRouterClient ¶
func NewTCPRouterClient(addr string, dc meim.DataCreator, subCmd, unsubCmd int) *TCPBrokerClient
func (*TCPBrokerClient) Close ¶
func (tr *TCPBrokerClient) Close()
func (*TCPBrokerClient) Connect ¶
func (tr *TCPBrokerClient) Connect()
func (*TCPBrokerClient) ReceiveMessage ¶
func (tr *TCPBrokerClient) ReceiveMessage() (*meim.InternalMessage, error)
func (*TCPBrokerClient) SendMessage ¶
func (tr *TCPBrokerClient) SendMessage(msg *meim.InternalMessage) error
func (*TCPBrokerClient) Subscribe ¶
func (tr *TCPBrokerClient) Subscribe(uid int64)
func (*TCPBrokerClient) SyncMessage ¶
func (tr *TCPBrokerClient) SyncMessage(msg *meim.InternalMessage) (*meim.InternalMessage, error)
func (*TCPBrokerClient) UnSubscribe ¶
func (tr *TCPBrokerClient) UnSubscribe(uid int64)
Click to show internal directories.
Click to hide internal directories.