models

package
v0.0.0-...-eeae653 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeConn

type NodeConn struct {

	// socket handle
	Socket *net.Conn
	// contains filtered or unexported fields
}

NodeConn 客制化连接对象

func (*NodeConn) Build

func (nodeConn *NodeConn) Build(socket *net.Conn, connType string)

Build 构建自己

func (*NodeConn) GetConnType

func (nodeConn *NodeConn) GetConnType() string

GetConnType 获取自己的唯一标识

func (*NodeConn) GetDestroy

func (nodeConn *NodeConn) GetDestroy() bool

GetDestroy 反射

func (*NodeConn) GetNodeConnID

func (nodeConn *NodeConn) GetNodeConnID() string

GetNodeConnID 获取自己的唯一标识

func (*NodeConn) GetNodeID

func (nodeConn *NodeConn) GetNodeID() string

GetNodeID 获取自己的唯一标识

func (*NodeConn) GetSenderIP

func (nodeConn *NodeConn) GetSenderIP() string

GetSenderIP 反射

func (*NodeConn) GetSenderServicePort

func (nodeConn *NodeConn) GetSenderServicePort() string

GetSenderServicePort 反射

func (*NodeConn) GetSocket

func (nodeConn *NodeConn) GetSocket() *net.Conn

GetSocket 反射

func (*NodeConn) GetTargetNodeID

func (nodeConn *NodeConn) GetTargetNodeID() string

GetTargetNodeID 设置本地子节点的NodeID

func (*NodeConn) GetTs

func (nodeConn *NodeConn) GetTs() int64

GetTs 反射ts

func (*NodeConn) IsShaked

func (nodeConn *NodeConn) IsShaked() bool

IsShaked 检查这个连接是否已经握手完成

func (*NodeConn) SetDestroy

func (nodeConn *NodeConn) SetDestroy()

SetDestroy 节点收到需要关闭这个连接的请求

func (*NodeConn) SetNodeID

func (nodeConn *NodeConn) SetNodeID(nodeID string)

SetNodeID 设置这个连接的发起地址信息。 @param nodeID string

func (*NodeConn) SetRemoteAddr

func (nodeConn *NodeConn) SetRemoteAddr(remoteAddr string)

SetRemoteAddr 设置这个连接的发起地址信息。 @param remoteAddr ip:port

func (*NodeConn) SetShaker

func (nodeConn *NodeConn) SetShaker(data interface{}) *error.Error

SetShaker 握手包来了,找到对应的conn,设置shaker

func (*NodeConn) SetTargetNodeID

func (nodeConn *NodeConn) SetTargetNodeID(targetNodeID string)

SetTargetNodeID 设置本地子节点的NodeID

Jump to

Keyboard shortcuts

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